-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM docker.io/arm64v8/python:3-slim as builder | ||
|
||
RUN pip install poetry | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/expenses-cache | ||
|
||
WORKDIR /app | ||
|
||
COPY src/pyproject.toml src/poetry.lock ./ | ||
|
||
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root | ||
|
||
FROM docker.io/arm64v8/python:3-slim as runtime | ||
|
||
ENV VIRTUAL_ENV=/app/.venv \ | ||
PATH="/app/.venv/bin:$PATH" | ||
|
||
|
||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
WORKDIR /app | ||
|
||
|
||
COPY ./src/expenses_server /app/expenses_server | ||
COPY ./src/alembic /app/alembic | ||
COPY ./src/alembic.ini /app/ | ||
COPY ./src/static /app/static | ||
|
||
COPY ./docker-entrypoint.sh /app/ | ||
|
||
ENV FRONTEND_PATH=/app/static | ||
|
||
EXPOSE 8000 | ||
|
||
ENTRYPOINT ["./docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters