Skip to content

Commit

Permalink
Update Dockerfile with build-time optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
jb3 committed Aug 19, 2024
1 parent e71a8d5 commit d5e4477
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions thallium-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM python:3.12-slim

# Define Git SHA build argument for sentry
ARG git_sha="development"
ENV GIT_SHA=$git_sha

RUN apt update -y \
&& apt install -y curl \
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -13,10 +9,13 @@ WORKDIR /thallium
COPY requirements.txt ./
RUN pip install -r requirements.txt

# Copy the source code in last to optimize rebuilding the image
COPY . .

HEALTHCHECK --start-period=5s --interval=30s --timeout=1s CMD curl http://localhost/heartbeat || exit 1

# Define Git SHA build argument for sentry
ARG git_sha="development"
ENV GIT_SHA=$git_sha

ENTRYPOINT ["/bin/bash", "-c"]
CMD ["alembic upgrade head && uvicorn src.app:fastapi_app --host 0.0.0.0 --port 8000 --no-server-header"]

0 comments on commit d5e4477

Please sign in to comment.