-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile
30 lines (21 loc) · 892 Bytes
/
Dockerfile
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
FROM python:3.11-slim-bookworm AS base
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Copy the project into the image
ADD . /mzai
WORKDIR /mzai/lumigator/backend
ENV PYTHONPATH=/mzai/lumigator/backend:/mzai/lumigator/jobs
FROM base AS main_image
# Sync the project into a new environment, using the frozen lockfile and no dev dependencies
RUN uv sync --no-dev --frozen
CMD ["uv", "run", "--no-dev", "uvicorn", "--host", "0.0.0.0", "--port", "8000", "backend.main:app"]
FROM base AS dev_image
# Sync the project into a new environment, using the frozen lockfile and all dependencies
RUN uv sync --frozen
CMD [\
"uv","run", "-m", "debugpy", "--listen", "0.0.0.0:5678", \
"-m", "uvicorn", "backend.main:app", "--reload", \
"--reload-dir", "/mzai/lumigator/jobs", \
"--reload-dir", "/mzai/lumigator/schemas", \
"--host", "0.0.0.0", \
"--port", "8000" \
]