-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (22 loc) · 761 Bytes
/
Dockerfile
File metadata and controls
38 lines (22 loc) · 761 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
# This monolith Dockerfile:
# Uses FastAPI to serve static assets
# Uses gunicorn as a process manager to run the FastAPI app
FROM node:16 as frontend-build
WORKDIR /app
COPY frontend/package.json frontend/yarn.lock /app/
RUN yarn
COPY frontend /app/
RUN yarn build
FROM python:3.10
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
COPY backend/pyproject.toml backend/poetry.lock /app/
RUN poetry install --no-root
COPY backend /app
COPY --from=frontend-build /app/build /app/static
CMD gunicorn -k uvicorn.workers.UvicornWorker -b :8000 main:app