Severian commited on
Commit
6856dac
1 Parent(s): e3a6f0b

Update Dockerfile for correct directory structure

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -4
Dockerfile CHANGED
@@ -67,6 +67,9 @@ RUN apt-get update && \
67
  WORKDIR /app
68
  RUN mkdir -p api web && chown -R user:user /app
69
 
 
 
 
70
  # Copy Python environment and set permissions
71
  COPY --from=python-builder --chown=user /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
72
  COPY --chown=user api/ /app/api/
@@ -77,9 +80,6 @@ COPY --from=web-builder --chown=user /app/web/public /app/web/public
77
  COPY --from=web-builder --chown=user /app/web/node_modules /app/web/node_modules
78
  COPY --from=web-builder --chown=user /app/web/package.json /app/web/package.json
79
 
80
- # Install gunicorn
81
- RUN pip install --no-cache-dir gunicorn gevent
82
-
83
  # Set environment variables
84
  ENV FLASK_APP=app.py \
85
  EDITION=SELF_HOSTED \
@@ -89,7 +89,9 @@ ENV FLASK_APP=app.py \
89
  SERVICE_API_URL=http://127.0.0.1:7860 \
90
  APP_WEB_URL=http://127.0.0.1:3000 \
91
  NODE_ENV=production \
92
- HOME=/app
 
 
93
 
94
  # Switch to the non-root user
95
  USER user
 
67
  WORKDIR /app
68
  RUN mkdir -p api web && chown -R user:user /app
69
 
70
+ # Install Python packages globally
71
+ RUN pip install --no-cache-dir gunicorn gevent flask
72
+
73
  # Copy Python environment and set permissions
74
  COPY --from=python-builder --chown=user /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
75
  COPY --chown=user api/ /app/api/
 
80
  COPY --from=web-builder --chown=user /app/web/node_modules /app/web/node_modules
81
  COPY --from=web-builder --chown=user /app/web/package.json /app/web/package.json
82
 
 
 
 
83
  # Set environment variables
84
  ENV FLASK_APP=app.py \
85
  EDITION=SELF_HOSTED \
 
89
  SERVICE_API_URL=http://127.0.0.1:7860 \
90
  APP_WEB_URL=http://127.0.0.1:3000 \
91
  NODE_ENV=production \
92
+ HOME=/app \
93
+ PATH="/usr/local/bin:${PATH}" \
94
+ PYTHONPATH=/app/api
95
 
96
  # Switch to the non-root user
97
  USER user