-
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
1 changed file
with
27 additions
and
0 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,27 @@ | ||
FROM python:3.13-slim AS base | ||
|
||
FROM base AS dependencies | ||
|
||
# Install uv | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
||
# Change the working directory to the `app` directory | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
--mount=type=bind,source=uv.lock,target=uv.lock \ | ||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \ | ||
uv sync --frozen --no-install-project --no-editable --compile-bytecode | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
# Copy the environment | ||
COPY --from=dependencies --chown=app:app /app/.venv /app/.venv | ||
|
||
# Copy the application | ||
COPY ./main.py /app | ||
|
||
# Run the application | ||
CMD [".venv/bin/python", "main.py"] |