feat: Docker image
This commit is contained in:
parent
6455087893
commit
4fcd7bc49d
3 changed files with 96 additions and 0 deletions
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
FROM ghcr.io/astral-sh/uv:0.9-python3.12-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk update \
|
||||
&& apk add gcc python3-dev musl-dev linux-headers
|
||||
|
||||
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-workspace
|
||||
|
||||
ADD . /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --locked
|
||||
|
||||
FROM python:3.12-alpine3.22
|
||||
|
||||
RUN apk update --no-cache \
|
||||
&& apk add --no-cache git
|
||||
|
||||
COPY --from=builder --chown=app:app /app/.venv /app/.venv
|
||||
COPY --from=builder --chown=app:app /app/app /app/app
|
||||
|
||||
ENV PYTHONPATH="/app"
|
||||
|
||||
ENTRYPOINT ["app/.venv/bin/python"]
|
||||
|
||||
CMD ["/app/app/main.py"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue