-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 765 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM python:3.13-slim-bookworm
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
ENV PATH="/app/.venv/bin:$PATH"
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates postgresql && apt-get clean
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
RUN mkdir /htb/
ENV PYTHONPATH=/htb/
COPY ./pyproject.toml ./uv.lock ./.env /htb/
COPY ./app /htb/app
WORKDIR /htb
# install python dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen
EXPOSE 8000