soiz1's picture
Create Dockerfile
dd24ae4 verified
raw
history blame
1.2 kB
# ベースイメージ
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# 必要なシステムパッケージをインストール
COPY packages.txt .
RUN apt-get update && \
xargs -a packages.txt apt-get install -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# モデルファイルのダウンロード
RUN wget -nc https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth && \
wget -nc https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.2.pth && \
wget -nc https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth && \
wget -nc https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.4.pth && \
wget -nc https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/RestoreFormer.pth && \
wget -nc https://github.com/TencentARC/GFPGAN/releases/download/v1.3.4/CodeFormer.pth
# Pythonの依存パッケージをインストール
COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt
# アプリケーションコードをコピー
COPY . .
# アプリの実行
CMD ["python", "app.py"]