-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 725 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 725 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
# Stage 1: Build stage
FROM python:3.10.11 as builder
WORKDIR /app
# Copy requirements.txt to the container
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools wheel
# Install dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the application source code
COPY . .
RUN rm requirements.txt
# Stage 2: Production stage
FROM builder
WORKDIR /app
# Copy the installed dependencies from the previous stage
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
# Copy the application source code from the previous stage
COPY --from=builder /app/* .
# Expose port 5000
EXPOSE 8080
CMD ["python","server.py"]