-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
30 lines (21 loc) · 854 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
# Use an official Python runtime as a parent image
FROM python:3.9-slim as builder
# Set the working directory in the container to /app
WORKDIR /app
# Add current directory code to /app in the container
ADD . /app
# Install any needed packages specified in requirements.txt
RUN pip install --upgrade pip && \
pip install --user -r requirements.txt
# This is the second stage where we create the runtime image
FROM python:3.9-slim
# Copy the dependencies from the build stage
COPY --from=builder /root/.local /root/.local
# Make sure scripts in .local are usable:
ENV PATH=/root/.local/bin:$PATH
# Set the working directory in the container to /app
WORKDIR /app
# Add current directory code to /app in the container
ADD . /app
# Command to run the uvicorn server
CMD ["python", "-m", "backend.app.main", "--mode", "prod", "--host", "0.0.0.0"]