npm ci is safer than npm i, and avoid installing serve globally

This commit is contained in:
burnettk 2022-10-06 15:18:58 -04:00
parent 965fa2871e
commit 09fe6b4054
2 changed files with 2 additions and 31 deletions

View File

@ -5,8 +5,6 @@ WORKDIR /app
ADD package.json /app/
ADD package-lock.json /app/
COPY . /app/
RUN npm install && \
npm run build
RUN npm ci && npm run build
RUN npm install -g serve
ENTRYPOINT ["/app/bin/boot_server_in_docker"]

View File

@ -7,31 +7,4 @@ function error_handler() {
trap 'error_handler ${LINENO} $?' ERR
set -o errtrace -o errexit -o nounset -o pipefail
# # run migrations
# export FLASK_APP=/app/src/spiffworkflow_backend
#
# if [ "${DOWNGRADE_DB:-}" = "true" ]; then
# echo 'Downgrading database...'
# poetry run flask db downgrade
# fi
#
# if [ "${UPGRADE_DB:-}" = "true" ]; then
# echo 'Upgrading database...'
# poetry run flask db upgrade
# fi
#
# port="${PORT0:-}"
# if [[ -z "$port" ]]; then
# port=7000
# fi
#
# additional_args=""
#
# if [[ "${APPLICATION_ROOT:-}" != "/" ]]; then
# additional_args="${additional_args} -e SCRIPT_NAME=${APPLICATION_ROOT}"
# fi
#
# # THIS MUST BE THE LAST COMMAND!
# exec poetry run gunicorn ${additional_args} --bind "0.0.0.0:$PORT0" --workers=3 --timeout 90 --log-level debug wsgi:app
exec serve -s build -l "$PORT0"
exec ./node_modules/.bin/serve -s build -l "$PORT0"