ndlkotenocr-lite / Dockerfile
nakamura196's picture
fix: bug
c39e953
raw
history blame contribute delete
890 Bytes
# ベースイメージ
FROM python:3.10-slim AS base
# 作業ディレクトリを設定
WORKDIR /home/user/app
# 必要なパッケージをインストール
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY .git /home/user/app/.git
# COPY .gitmodules /home/user/app/
COPY src /home/user/app/src
COPY requirements.txt /home/user/app/
COPY install.sh /home/user/app/
# install.sh を実行可能にして実行
RUN chmod +x /home/user/app/install.sh && /home/user/app/install.sh
RUN pip install --no-cache-dir -r requirements.txt
# 作業ディレクトリを `src` に移動
WORKDIR /home/user/app/src
# 開発環境用のステージ
FROM base AS development
# アプリを起動
CMD ["gradio", "app.py"]
# 本番環境用のステージ
FROM base AS production
CMD ["python", "app.py"]