diff --git a/docker/prod/Dockerfile b/docker/prod/Dockerfile index 44aa4791..fe229acc 100644 --- a/docker/prod/Dockerfile +++ b/docker/prod/Dockerfile @@ -10,6 +10,18 @@ ARG SITE_PACKAGES_DIR=/usr/local/lib/python3.6/site-packages ENV APP_DIR "${APP_DIR}" ENV SKIP_PIPENV true +# Set port to open +EXPOSE "${APP_PORT}" + +# Run as the unprivileged APP user +USER "${APP_USER}" + +# Use dumb-init for proper signal handling +ENTRYPOINT ["/usr/bin/dumb-init", "--"] + +# Default command is to launch the server +CMD ["bash", "-c", "${APP_DIR}/script/server"] + # Copy installed python packages from the tester image COPY --from=atst-tester:latest "${SITE_PACKAGES_DIR}" "${SITE_PACKAGES_DIR}" @@ -26,15 +38,3 @@ RUN set -x ; \ # Update file ownership RUN set -x ; \ chown -R atst:atat "${APP_DIR}" - -# Set port to open -EXPOSE "${APP_PORT}" - -# Run as the unprivileged APP user -USER "${APP_USER}" - -# Use dumb-init for proper signal handling -ENTRYPOINT ["/usr/bin/dumb-init", "--"] - -# Default command is to launch the server -CMD ["bash", "-c", "${APP_DIR}/script/server"] diff --git a/docker/tester/Dockerfile b/docker/tester/Dockerfile index 856f51dc..d54e661f 100644 --- a/docker/tester/Dockerfile +++ b/docker/tester/Dockerfile @@ -7,6 +7,12 @@ ARG CIBUILD=true ENV SKIP_PIPENV true +# Use dumb-init for proper signal handling +ENTRYPOINT ["/usr/bin/dumb-init", "--"] + +# Default command is to run all the tests +CMD ["${APP_DIR}/script/cibuild"] + # Create application directory RUN set -x ; \ mkdir -p ${APP_DIR} @@ -25,8 +31,3 @@ RUN set -x ; \ RUN set -x ; \ script/setup -# Use dumb-init for proper signal handling -ENTRYPOINT ["/usr/bin/dumb-init", "--"] - -# Default command is to run all the tests -CMD ["${APP_DIR}/script/cibuild"]