-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,21 @@ | ||
FROM ubuntu:22.04 | ||
FROM python:3.10-slim | ||
|
||
# apt换源,安装pip | ||
RUN echo "==> 换成清华源,并更新..." && \ | ||
sed -i s@/archive.ubuntu.com/@/mirrors.tuna.tsinghua.edu.cn/@g /etc/apt/sources.list && \ | ||
sed -i s@/security.ubuntu.com/@/mirrors.tuna.tsinghua.edu.cn/@g /etc/apt/sources.list && \ | ||
apt-get clean && \ | ||
apt-get update | ||
|
||
# 安装python3.10 | ||
RUN apt-get install -y python3 curl && \ | ||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ | ||
python3 get-pip.py && \ | ||
pip3 install -U pip && \ | ||
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | ||
|
||
# 安装ffmpeg等库 | ||
RUN apt-get install libpython3.10-dev ffmpeg libgl1-mesa-glx libglib2.0-0 cmake -y && \ | ||
pip3 install --no-cache-dir cmake | ||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
ffmpeg \ | ||
libgl1-mesa-glx \ | ||
libglib2.0-0 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
COPY requirements.txt requirements-app.txt ./ | ||
|
||
RUN pip3 install -r requirements.txt && \ | ||
pip3 install -r requirements-app.txt | ||
RUN pip install --no-cache-dir -r requirements.txt -r requirements-app.txt | ||
|
||
RUN echo "==> Clean up..." && \ | ||
rm -rf ~/.cache/pip | ||
|
||
# 指定工作目录 | ||
COPY . . | ||
|
||
EXPOSE 7860 | ||
EXPOSE 8080 | ||
|
||
CMD [ "python3", "-u", "app.py", "--host", "0.0.0.0", "--port", "7860"] | ||
CMD ["python3", "-u", "app.py", "--host", "0.0.0.0", "--port", "7860"] |