Support other webapp types (react, static). #721

Merged
telackey merged 8 commits from telackey/webapp-detect into main 2024-02-03 00:04:06 +00:00
6 changed files with 11 additions and 7 deletions
Showing only changes of commit c6a8a2324e - Show all commits

View File

@ -36,7 +36,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# RUN su node -c "npm install -g <your-package-list-here>"
# Expose port for http
EXPOSE 3000
EXPOSE 80
COPY /scripts /scripts

View File

@ -58,4 +58,4 @@ if [ "$CERC_NEXTJS_SKIP_GENERATE" != "true" ]; then
fi
fi
$CERC_BUILD_TOOL start . -p ${CERC_LISTEN_PORT:-3000}
$CERC_BUILD_TOOL start . -- -p ${CERC_LISTEN_PORT:-80}

View File

@ -49,7 +49,7 @@ COPY ./config.yml /config
RUN yarn global add http-server
# Expose port for http
EXPOSE 3000
EXPOSE 80
# Default command sleeps forever so docker doesn't kill it
CMD ["/scripts/start-serving-app.sh"]

View File

@ -8,4 +8,4 @@ RUN rm -rf node_modules build .next*
RUN /scripts/build-app.sh /app build /data
FROM cerc/webapp-base:local
COPY --from=builder /data /data
COPY --from=builder /data /data

View File

@ -4,7 +4,12 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
fi
CERC_WEBAPP_FILES_DIR="${CERC_WEBAPP_FILES_DIR:-/data}"
CERC_ENABLE_CORS="${CERC_ENABLE_CORS:-false}"
if [ "true" == "$CERC_ENABLE_CORS" ]; then
CERC_HTTP_EXTRA_ARGS="$CERC_HTTP_EXTRA_ARGS --cors"
fi
/scripts/apply-webapp-config.sh /config/config.yml ${CERC_WEBAPP_FILES_DIR}
/scripts/apply-runtime-env.sh ${CERC_WEBAPP_FILES_DIR}
http-server --cors -p 3000 ${CERC_WEBAPP_FILES_DIR}
http-server $CERC_HTTP_EXTRA_ARGS -p ${CERC_LISTEN_PORT:-80} ${CERC_WEBAPP_FILES_DIR}

View File

@ -27,8 +27,7 @@ from dotenv import dotenv_values
from stack_orchestrator import constants
from stack_orchestrator.deploy.deployer_factory import getDeployer
WEBAPP_PORT = 3000
WEBAPP_PORT = 80
@click.command()
@click.option("--image", help="image to deploy", required=True)