Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +19 -0
Dockerfile
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ベースイメージとして公式のPythonイメージを使用
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# 作業ディレクトリを設定
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# requirements.txtをコピーしてパッケージをインストール
|
8 |
+
COPY requirements.txt requirements.txt
|
9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
+
|
11 |
+
# Redisをインストール
|
12 |
+
RUN apt-get update && apt-get install -y redis-server
|
13 |
+
|
14 |
+
# アプリケーションのコードをコピー
|
15 |
+
COPY . .
|
16 |
+
|
17 |
+
|
18 |
+
# Redisをバックグラウンドで起動してからアプリケーションを起動
|
19 |
+
CMD redis-server --daemonize yes && python app.py
|