TRMT commited on
Commit
b56a449
·
1 Parent(s): 620c793

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -6
Dockerfile CHANGED
@@ -1,11 +1,25 @@
1
- FROM python:3.9
 
2
 
3
- WORKDIR /code
 
4
 
5
- COPY ./requirements.txt /code/requirements.txt
 
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
8
 
9
- COPY . .
 
 
 
 
 
10
 
11
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0/word_search", "--port", "7860"]
 
 
 
 
 
1
+ # ベースイメージを選択
2
+ FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
3
 
4
+ # 作業ディレクトリを設定
5
+ WORKDIR /app
6
 
7
+ RUN mkdir /app/CACHE/ && chmod -R 777 /app/CACHE/
8
+ ENV TRANSFORMERS_CACHE /app/CACHE/
9
 
10
+ # 依存関係をインストール
11
+ COPY requirements.txt /app/
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # FastAPIアプリケーションのコードをコピー
15
+ COPY app /app
16
+ COPY static /app/static
17
+ COPY model /app/model
18
+ COPY data /app/data
19
+ COPY templates /app/templates
20
 
21
+ # Expose port 8000 for FastAPI to run on
22
+ EXPOSE 8000
23
+
24
+ # Command to run the application
25
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0/word_search", "--port", "8000"]