-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 1016 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 1016 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
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install
# !!!! WARNING !!!!
# The pip config below uses Tsinghua University mirror (pypi.tuna.tsinghua.edu.cn).
# This mirror is optimized for users in mainland China. If you are outside mainland China,
# DO NOT use this mirror. Comment out or remove the pip config lines below to use the default PyPI.
COPY backend/requirements.txt .
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/ && \
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn && \
# pip config set global.extra-index-url https://pypi.org/simple && \
pip config set global.timeout 600 && \
pip config set global.retries 10 && \
pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ .
# Expose port
EXPOSE 8002
# Run the app
CMD ["python", "run.py"]