-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (23 loc) · 699 Bytes
/
Dockerfile
File metadata and controls
40 lines (23 loc) · 699 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
FROM node:20-alpine AS frontend-builder
WORKDIR /frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM python:3.11-slim
WORKDIR /app
RUN pip install poetry==1.8.4
RUN poetry config virtualenvs.create false
COPY backend/ ./
ARG APP_ENV=production
ENV APP_ENV=${APP_ENV}
RUN if [ "$APP_ENV" = "dev" ]; then \
poetry install --no-interaction --no-ansi; \
else \
poetry install --no-interaction --no-ansi --without dev; \
fi
COPY --from=frontend-builder /frontend/dist ./static
RUN mkdir -p /app/data
RUN mkdir -p /app/alembic/versions
EXPOSE 8000
CMD alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000