mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-05 00:01:00 +00:00
Dockerfile optimization
This commit is contained in:
parent
871e397638
commit
527a66c2af
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Development
|
||||||
|
.dockerignore
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.github
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Application
|
||||||
|
venv/
|
27
Dockerfile
27
Dockerfile
@ -1,18 +1,29 @@
|
|||||||
FROM python:3.10
|
FROM python:3.11 as builder
|
||||||
|
|
||||||
|
WORKDIR /usr/app
|
||||||
|
ENV PATH="/usr/app/venv/bin:$PATH"
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y git
|
RUN apt-get update && apt-get install -y git
|
||||||
|
RUN mkdir -p /usr/app
|
||||||
|
RUN python -m venv ./venv
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/gpt4free
|
COPY requirements.txt .
|
||||||
WORKDIR /usr/src/gpt4free
|
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
# RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
# RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
|
||||||
# RUN pip config set global.trusted-host mirrors.aliyun.com
|
# RUN pip config set global.trusted-host mirrors.aliyun.com
|
||||||
|
|
||||||
COPY requirements.txt /usr/src/gpt4free/
|
FROM python:3.11-alpine
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
|
||||||
COPY . /usr/src/gpt4free
|
|
||||||
RUN cp gui/streamlit_app.py .
|
|
||||||
|
|
||||||
EXPOSE 8501
|
WORKDIR /usr/app
|
||||||
|
ENV PATH="/usr/app/venv/bin:$PATH"
|
||||||
|
|
||||||
|
COPY --from=builder /usr/app/venv ./venv
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN cp ./gui/streamlit_app.py .
|
||||||
|
|
||||||
CMD ["streamlit", "run", "streamlit_app.py"]
|
CMD ["streamlit", "run", "streamlit_app.py"]
|
||||||
|
|
||||||
|
EXPOSE 8501
|
||||||
|
Loading…
Reference in New Issue
Block a user