Skip to content

Commit

Permalink
ci: misc adjustments for python (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Dec 11, 2024
1 parent 1278928 commit fc34a17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions backend-py/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ ENV PYTHONUNBUFFERED=1 \

# Packages
RUN apt update && \
apt install -y --no-install-recommends curl libpq-dev
apt install -y --no-install-recommends libpq-dev

# Dependencies, config and app
COPY --from=build /app/.venv /app/.venv
COPY logger.conf ./
COPY ./src ./src

HEALTHCHECK --interval=300s --timeout=10s CMD timeout 10s sh -c 'true > http://localhost:${PORT} || exit 1'

# Start with non-privileged user
HEALTHCHECK --interval=300s --timeout=10s CMD curl -f http://localhost:${PORT}
USER 1001
SHELL ["/bin/bash", "-c"]
ENTRYPOINT uvicorn src.main:app --host 0.0.0.0 --port ${PORT} --workers 1 --server-header --date-header --limit-concurrency 1000 --log-config ./logger.conf
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ services:
entrypoint: /application/start-local.sh
volumes: ["./backend-py:/application", "/application/.venv"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
test: timeout 10s bash -c 'true > /dev/tcp/127.0.0.1/3000'

environment:
<<: [*postgres-vars, *python-vars]
ports: ["3003:3000"]
Expand Down

0 comments on commit fc34a17

Please sign in to comment.