first commit
All checks were successful
Build Docker Image / build-and-deploy-image (push) Successful in 38s
All checks were successful
Build Docker Image / build-and-deploy-image (push) Successful in 38s
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM ghcr.io/astral-sh/uv:python3.12-alpine AS builder
|
||||
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
||||
WORKDIR /app
|
||||
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-dev
|
||||
COPY pyproject.toml uv.lock /app/
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --frozen --no-dev
|
||||
|
||||
|
||||
FROM python:3.12-alpine
|
||||
WORKDIR /app
|
||||
|
||||
# hadolint ignore=DL3018
|
||||
RUN apk add --no-cache tini
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
COPY --from=builder /app /app
|
||||
COPY app.py /app/
|
||||
|
||||
EXPOSE 8000
|
||||
ENTRYPOINT ["tini", "--"]
|
||||
CMD ["granian", "--workers", "1", "--host", "0.0.0.0", "--interface", "asgi", "app:app"]
|
||||
Reference in New Issue
Block a user