-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (40 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
51 lines (40 loc) · 1.26 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
# Use Debian 11.11 as the base image
FROM debian:11.11
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1
# Use Aliyun's Debian mirror
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
pandoc \
texlive-latex-base \
texlive-fonts-recommended \
texlive-extra-utils \
texlive-xetex \
fonts-noto-cjk \
texlive-plain-generic \
texlive-lang-chinese \
texlive-latex-extra \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Configure pip to use Aliyun's mirror
RUN pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
pip3 config set install.trusted-host mirrors.aliyun.com
# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Create uploads directory
RUN mkdir -p uploads
# Expose the port the app runs on
EXPOSE 5000
# Command to run the application
CMD ["python3", "app.py"]