leonsimon23 commited on
Commit
85f8636
·
verified ·
1 Parent(s): 0953042

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -2
Dockerfile CHANGED
@@ -18,6 +18,13 @@ RUN --mount=type=secret,id=GITHUB_TOKEN,required=true \
18
  RUN mkdir -p /app/instance/sessions && \
19
  chmod -R 777 /app/instance
20
 
 
 
 
 
 
 
 
21
  # Install Python dependencies
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
@@ -27,7 +34,7 @@ RUN echo '#!/bin/bash\n\
27
  set -e\n\
28
  echo "===== Application Startup at $(date) ====="\n\
29
  echo "Initializing database..."\n\
30
- export PYTHONPATH=/app:${PYTHONPATH}\n\
31
  python3 -c "from app import init_db; init_db()"\n\
32
  echo "Database initialized successfully."\n\
33
  echo "Starting Gunicorn server..."\n\
@@ -42,7 +49,7 @@ ENV FLASK_ENV=production
42
  ENV HOST=0.0.0.0
43
  ENV PORT=7860
44
  ENV PYTHONUNBUFFERED=1
45
- ENV PYTHONPATH=/app:${PYTHONPATH}
46
  ENV DIFY_API_KEY=${DIFY_API_KEY}
47
  ENV DIFY_API_BASE_URL=${DIFY_API_BASE_URL}
48
  ENV DIFY_APP_ID=${DIFY_APP_ID}
 
18
  RUN mkdir -p /app/instance/sessions && \
19
  chmod -R 777 /app/instance
20
 
21
+ # Create __init__.py files to make Python packages
22
+ RUN touch /app/app/__init__.py && \
23
+ touch /app/app/api/__init__.py && \
24
+ touch /app/app/config/__init__.py && \
25
+ touch /app/app/services/__init__.py && \
26
+ touch /app/app/models/__init__.py
27
+
28
  # Install Python dependencies
29
  RUN pip install --no-cache-dir -r requirements.txt
30
 
 
34
  set -e\n\
35
  echo "===== Application Startup at $(date) ====="\n\
36
  echo "Initializing database..."\n\
37
+ export PYTHONPATH=/app:$PYTHONPATH\n\
38
  python3 -c "from app import init_db; init_db()"\n\
39
  echo "Database initialized successfully."\n\
40
  echo "Starting Gunicorn server..."\n\
 
49
  ENV HOST=0.0.0.0
50
  ENV PORT=7860
51
  ENV PYTHONUNBUFFERED=1
52
+ ENV PYTHONPATH=/app
53
  ENV DIFY_API_KEY=${DIFY_API_KEY}
54
  ENV DIFY_API_BASE_URL=${DIFY_API_BASE_URL}
55
  ENV DIFY_APP_ID=${DIFY_APP_ID}