-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (25 loc) · 939 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (25 loc) · 939 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
32
33
34
35
36
37
38
FROM python:3.11-slim-bookworm AS build
ARG UV_VERSION=0.11.28
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_LINK_MODE=copy
WORKDIR /app
RUN pip install --no-cache-dir "uv==${UV_VERSION}"
COPY pyproject.toml uv.lock README.md ./
COPY src ./src
RUN uv sync --locked --no-dev
FROM python:3.11-slim-bookworm
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH=/app/.venv/bin:$PATH
WORKDIR /app
RUN groupadd --system debugrelay \
&& useradd --system --gid debugrelay --home-dir /app debugrelay
COPY --from=build --chown=debugrelay:debugrelay /app/.venv ./.venv
COPY --chown=debugrelay:debugrelay src ./src
COPY --chown=debugrelay:debugrelay alembic.ini ./
COPY --chown=debugrelay:debugrelay alembic ./alembic
COPY --chown=debugrelay:debugrelay schemas ./schemas
USER debugrelay
EXPOSE 8010
CMD ["sh", "-c", "alembic upgrade head && exec uvicorn debugrelay.main:app --host 0.0.0.0 --port 8010"]