-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 1019 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (28 loc) · 1019 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
39
40
# Stage 1: Frontend build
FROM --platform=linux/amd64 node:20 AS frontend-build
WORKDIR /frontend
COPY src/frontend/package*.json ./
RUN npm ci
COPY src/frontend ./
RUN npm run build
# Stage 2: Backend setup
FROM python:3.9-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH="/vvsu-schedule/src" \
TZ=Asia/Vladivostok
WORKDIR /vvsu-schedule
RUN apt-get update && apt-get install -y --no-install-recommends \
curl tzdata ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir poetry==2.1.1 \
&& poetry config virtualenvs.create false \
&& poetry self add poetry-plugin-shell
COPY pyproject.toml poetry.lock ./
COPY alembic.ini ./
COPY alembic ./alembic
COPY src ./src
RUN poetry install --no-interaction --no-ansi
# Копируем статический билд фронта
COPY --from=frontend-build /frontend/dist ./src/frontend/dist
CMD ["poetry", "run", "uvicorn", "schedule_vvsu.api:app", "--host", "0.0.0.0", "--port", "8000"]