-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (39 loc) · 1.38 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM python:3.12.8-bookworm
# 设置非交互式前端,避免 apt-get 交互式提示
ENV DEBIAN_FRONTEND=noninteractive
# 设置时区
RUN echo "Asia/Shanghai" > /etc/timezone && \
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
apt-get update && \
apt-get install -y tzdata && \
dpkg-reconfigure --frontend noninteractive tzdata
RUN apt-get update && \
apt-get install -y build-essential ca-certificates libffi-dev libssl-dev libasound2 curl iputils-ping wget && \
apt-get install -y poppler-utils ffmpeg libpq-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# RUN wget -O - https://www.openssl.org/source/openssl-1.1.1u.tar.gz | tar zxf - && \
# cd openssl-1.1.1u && \
# ./config --prefix=/usr/local && \
# make -j $(nproc) && \
# make install_sw install_ssldirs && \
# ldconfig -v && \
# export SSL_CERT_DIR=/etc/ssl/certs
# 设置工作目录
WORKDIR /gptstudio
COPY requirements.txt ./requirements.txt
RUN pip install -r requirements.txt
# 复制项目文件
COPY ./.streamlit ./.streamlit
COPY ./assets ./assets
COPY ./common ./common
COPY ./gptstudio ./gptstudio
COPY ./assets ./assets
COPY ./gptstudio.py ./gptstudio.py
ENV STREAMLIT_SERVER_PORT=8501
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
# 暴露 Streamlit 默认端口
EXPOSE 8501
ENV PYTHONUNBUFFERED=1
# 设置启动命令
CMD ["streamlit","run", "gptstudio.py"]