Add Dockerfile
This commit is contained in:
parent
ee8a4f69fd
commit
d6a87f2b2b
2 changed files with 36 additions and 0 deletions
5
.dockerignore
Normal file
5
.dockerignore
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
out/
|
||||||
|
.git/
|
||||||
|
.jj/
|
||||||
|
|
||||||
|
.gitignore
|
||||||
31
Dockerfile
Normal file
31
Dockerfile
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
FROM python:3.13-slim AS base
|
||||||
|
# FROM ghcr.io/astral-sh/uv:0.8-debian-slim AS builder
|
||||||
|
#
|
||||||
|
# WORKDIR /app
|
||||||
|
#
|
||||||
|
# COPY pyproject.toml README.md uv.lock ./
|
||||||
|
#
|
||||||
|
# RUN uv sync --frozen
|
||||||
|
#
|
||||||
|
# COPY . /app
|
||||||
|
|
||||||
|
FROM base AS builder
|
||||||
|
COPY --from=ghcr.io/astral-sh/uv:0.8 /uv /bin/uv
|
||||||
|
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
|
||||||
|
WORKDIR /app
|
||||||
|
COPY uv.lock pyproject.toml /app/
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
|
uv sync --frozen --no-install-project --no-dev
|
||||||
|
COPY . /app
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
|
uv sync --frozen --no-dev
|
||||||
|
|
||||||
|
# TODO: Run as non-root user (but careful with output directory ownership)
|
||||||
|
FROM base AS runtime
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
|
COPY --from=builder /app /app
|
||||||
|
|
||||||
|
ENTRYPOINT ["nightjet"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue