Skip to content

Commit

Permalink
Fix runtime docker images (#446)
Browse files Browse the repository at this point in the history
* Reduce image size

* Fix runtime image startup
  • Loading branch information
c-w authored May 9, 2020
1 parent 0ba6e56 commit 0f28fab
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docker/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ COPY --from=compiler /app/dist/pkg.tar.gz /app/dist/pkg.tar.gz
RUN pip install --no-cache-dir "/app/dist/pkg.tar.gz[opwen_email_server]" \
&& rm -rf /tmp/pip-ephem-wheel-cache*

COPY --from=compiler /app/docker/client/run-gunicorn.sh /app/docker/client/run-gunicorn.sh
COPY --from=compiler /app/docker/client/webapp.env /app/docker/client/webapp.env
COPY --from=compiler /app/docker/client/client.env /app/docker/client/client.env
COPY --from=compiler /app/docker/client/run-*.sh /app/docker/client/
COPY --from=compiler /app/docker/client/*.env /app/docker/client/
COPY --from=compiler /app/manage.py /app/

ENV OPWEN_SESSION_KEY=changeme
ENV OPWEN_SETTINGS=/app/docker/client/webapp.env
16 changes: 16 additions & 0 deletions docker/integtest/0-wait-for-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,23 @@ wait_for_webapp() {
exit 4
}

wait_for_client() {
local i

for i in $(seq 1 "${max_retries}"); do
if curl -fs "http://client:5000/healthcheck/ping" >/dev/null; then
log "Client is running"
return
fi
log "Waiting for client (${i}/${max_retries})"
sleep "${polling_interval_seconds}s"
done

exit 5
}

wait_for_rabbitmq
wait_for_appinsights
wait_for_api
wait_for_webapp
wait_for_client
2 changes: 1 addition & 1 deletion docker/statuspage/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FROM builder AS compiler
RUN npm run build
RUN printf '{"scripts":{"start":"serve -n ."}}' > package-prod.json

FROM node:${NODE_VERSION} AS runtime
FROM node:${NODE_VERSION}-slim AS runtime

RUN npm install -g serve@11.3.0

Expand Down

0 comments on commit 0f28fab

Please sign in to comment.