返回提交历史
Added
.dockerignore
+9
-0
Modified
Dockerfile
+19
-8
XFEstudio/gpt4free
Dockerfile optimization
527a66c2
代码差异
2 个文件
+28
-8
@@ -0,0 +1,9 @@
1
# Development
2
.dockerignore
3
.git
4
.gitignore
5
.github
6
.idea
7
8
# Application
9
venv/
@@ -1,18 +1,29 @@
1
FROM python:3.10
1
FROM python:3.11 as builder
2
3
WORKDIR /usr/app
4
ENV PATH="/usr/app/venv/bin:$PATH"
2
5
3
6
RUN apt-get update && apt-get install -y git
7
RUN mkdir -p /usr/app
8
RUN python -m venv ./venv
9
10
COPY requirements.txt .
4
11
5
RUN mkdir -p /usr/src/gpt4free
6
WORKDIR /usr/src/gpt4free
12
RUN pip install -r requirements.txt
7
13
8
14
# RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
9
15
# RUN pip config set global.trusted-host mirrors.aliyun.com
10
16
11
COPY requirements.txt /usr/src/gpt4free/
12
RUN pip install --no-cache-dir -r requirements.txt
13
COPY . /usr/src/gpt4free
14
RUN cp gui/streamlit_app.py .
17
FROM python:3.11-alpine
15
18
16
EXPOSE 8501
19
WORKDIR /usr/app
20
ENV PATH="/usr/app/venv/bin:$PATH"
21
22
COPY --from=builder /usr/app/venv ./venv
23
COPY . .
24
25
RUN cp ./gui/streamlit_app.py .
17
26
18
27
CMD ["streamlit", "run", "streamlit_app.py"]
28
29
EXPOSE 8501