-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
22 lines (18 loc) · 607 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Build stage
FROM python:3.11-slim-bookworm as builder
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements.txt /app/requirements.txt
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Final stage
FROM python:3.11-slim-bookworm
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY . /app
# Define environment variable
ENV NAME=chat2gpt
# Make port 5000 available to the world outside this container
EXPOSE 5000
# Run server.py when the container launches
CMD ["python", "server.py"]