Score / Dokerfile
Corin1998's picture
Update Dokerfile
e643034 verified
raw
history blame contribute delete
731 Bytes
FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
MPLCONFIGDIR=/tmp/matplotlib
WORKDIR /home/user/app
# OSパッケージ(packages.txt 内のコメント/空行を無視してインストール)
COPY packages.txt /tmp/packages.txt
RUN set -eux; \
apt-get update; \
awk '!/^\s*($|#)/{print $1}' /tmp/packages.txt | xargs -r apt-get install -y; \
rm -rf /var/lib/apt/lists/*
# Python 依存
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -U pip && \
pip install --no-cache-dir -r /tmp/requirements.txt
# アプリ本体
COPY . /home/user/app
EXPOSE 7860
CMD ["python", "-m", "ui.ui_app"]