Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN python3 -m venv $POETRY_HOME && \
$POETRY_HOME/bin/poetry --version

WORKDIR $PYSETUP_PATH
COPY ./poetry.lock ./pyproject.toml ./
COPY poetry.lock pyproject.toml .
RUN $POETRY_HOME/bin/poetry install --no-root --only main

FROM python:3.12.7-slim AS production
Expand All @@ -39,7 +39,19 @@ RUN groupadd --gid $groupid app && \
USER app
WORKDIR /app

COPY --chown=app:app . .
# Copy only what is necessary to reduce image size and security risks
# FILES
COPY --chown=app:app \
alembic.ini \
asgi.py \
pyproject.toml \
version.json \
/app/
# DIRECTORIES
COPY --chown=app:app bin /app/bin
COPY --chown=app:app ctms /app/ctms
COPY --chown=app:app migrations /app/migrations
COPY --chown=app:app suppression-list /app/suppression-list
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally had the tests folder here too, thinking CI needed it, but it doesn't. Also, this is the only way I could find to copy the directories correctly.


EXPOSE $PORT
CMD ["python", "asgi.py"]