Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Dockerfile #536

Merged
merged 1 commit into from
May 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
FROM python:3.11 as builder

WORKDIR /usr/app
ENV PATH="/usr/app/venv/bin:$PATH"

RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*

RUN mkdir -p /usr/app
RUN python -m venv ./venv

COPY requirements.txt .

RUN pip install -r requirements.txt

# RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
# RUN pip config set global.trusted-host mirrors.aliyun.com

FROM python:3.11

WORKDIR /usr/app
ENV PATH="/usr/app/venv/bin:$PATH"
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*

COPY requirements.txt /tmp
RUN pip install --upgrade pip \
&& pip install -r /tmp/requirements.txt \
&& rm /tmp/requirements.txt

COPY --from=builder /usr/app/venv ./venv
COPY . .
COPY . /root/gpt4free

RUN cp ./gui/streamlit_app.py .
WORKDIR /root/gpt4free

CMD ["streamlit", "run", "streamlit_app.py"]
CMD ["streamlit", "run", "./gui/streamlit_app.py"]

EXPOSE 8501