ChatGPT-Face / Dockerfile
ztgeng's picture
add chown to user in COPY operations
450cb5e
raw
history blame contribute delete
No virus
1.26 kB
# 使用官方Python 3.9镜像作为基础镜像
FROM python:3.9
# 安装ffmpeg git
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y ffmpeg git
# 克隆GitHub仓库到容器中的/app目录
RUN git clone https://github.com/ZTGeng/ChatGPT-Face.git /app
# 设置工作目录
WORKDIR /app
# 复制外部网页文件到容器中
COPY --chown=user delay_message_en.html static/delay_message_en.html
COPY --chown=user delay_message_zh.html static/delay_message_zh.html
# 安装Python依赖
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# copy Wav2Lip预训练模型
RUN mkdir -p wav2lip/weights
COPY --chown=user wav2lip_gan.pth wav2lip/weights/wav2lip_gan.pth
# copy google credentials
RUN mkdir -p keys
RUN chmod -R 777 /app/keys
RUN mkdir -p temp
RUN chmod -R 777 /app/temp
ENV GOOGLE_APPLICATION_CREDENTIALS="keys/google-cloud-text-to-speech-key.json"
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
# ENV NUMBA_DISABLE_JIT=1
# RUN chmod -R 755 /usr/local/lib/python3.9/site-packages/librosa
# 暴露Flask运行所需的端口
EXPOSE 7860
# 复制启动脚本到容器
COPY --chown=user start.sh /start.sh
RUN chmod +x /start.sh
# 使用启动脚本来运行Flask应用
CMD ["/start.sh"]