Corin1998 commited on
Commit
83d69b8
·
verified ·
1 Parent(s): 706cc74

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -5
Dockerfile CHANGED
@@ -3,6 +3,7 @@
3
  FROM python:3.11-slim
4
  ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1
5
 
 
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  curl ca-certificates gcc build-essential \
8
  redis-server supervisor \
@@ -12,20 +13,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
12
 
13
  WORKDIR /app
14
 
15
- # 依存だけ先にコピー→インストール(キャッシュ
16
  COPY requirements.txt /app/requirements.txt
17
  RUN pip install -r /app/requirements.txt
18
 
19
- # アプリ本体を段階的にコピー
20
  COPY app /app/app
21
  COPY templates /app/templates
22
  COPY static /app/static
23
  COPY scripts /app/scripts
24
- COPY supervisor.conf /app/supervisor.conf
 
 
25
  COPY entrypoint.sh /app/entrypoint.sh
26
 
27
- RUN chmod +x /app/entrypoint.sh /app/scripts/init_db.py
28
- RUN mkdir -p /data/exports /var/log/supervisor
29
 
30
  ENV PORT=7860
31
  EXPOSE 7860
 
3
  FROM python:3.11-slim
4
  ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1
5
 
6
+ # OS deps
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  curl ca-certificates gcc build-essential \
9
  redis-server supervisor \
 
13
 
14
  WORKDIR /app
15
 
16
+ # 依存だけ先にコピー→インストール(キャッシュ効率化
17
  COPY requirements.txt /app/requirements.txt
18
  RUN pip install -r /app/requirements.txt
19
 
20
+ # アプリ本体
21
  COPY app /app/app
22
  COPY templates /app/templates
23
  COPY static /app/static
24
  COPY scripts /app/scripts
25
+
26
+ # supervisord の設定は「supervisord.conf」を使う
27
+ COPY supervisord.conf /app/supervisord.conf
28
  COPY entrypoint.sh /app/entrypoint.sh
29
 
30
+ RUN chmod +x /app/entrypoint.sh /app/scripts/init_db.py \
31
+ && mkdir -p /data/exports /var/log/supervisor
32
 
33
  ENV PORT=7860
34
  EXPOSE 7860