Peiyan commited on
Commit
35843b2
·
verified ·
1 Parent(s): d947b35

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -4
Dockerfile CHANGED
@@ -26,15 +26,16 @@ COPY ./backend ./backend
26
  RUN pip install -r ./backend/requirements.txt
27
 
28
  # Step #3: Configure nginx and flask
29
- COPY --from=build-step /app/frontend/build /usr/share/nginx/html
30
  COPY deployment/docker/nginx.conf /etc/nginx/sites-enabled/default
31
  COPY deployment/docker/serve.sh .
32
  RUN chmod +x ./serve.sh
33
 
34
  # Ensure nginx can write to necessary directories
35
- RUN mkdir -p /app/nginx/logs /var/lib/nginx/body /var/lib/nginx/proxy /var/lib/nginx/fastcgi /var/lib/nginx/uwsgi /var/lib/nginx/scgi \
36
- && touch /app/nginx/logs/error.log /app/nginx/logs/access.log \
37
- && chmod -R 755 /app/nginx/logs /var/lib/nginx
 
38
 
39
  # Remove the user directive if present
40
  RUN sed -i '/^user /d' /etc/nginx/nginx.conf
 
26
  RUN pip install -r ./backend/requirements.txt
27
 
28
  # Step #3: Configure nginx and flask
29
+ COPY --from=build-step /app/frontend/build /var/www/html
30
  COPY deployment/docker/nginx.conf /etc/nginx/sites-enabled/default
31
  COPY deployment/docker/serve.sh .
32
  RUN chmod +x ./serve.sh
33
 
34
  # Ensure nginx can write to necessary directories
35
+ RUN mkdir -p /var/lib/nginx/body /var/lib/nginx/proxy /var/lib/nginx/fastcgi /var/lib/nginx/uwsgi /var/lib/nginx/scgi /var/log/nginx /var/www/html \
36
+ && touch /var/log/nginx/error.log /var/log/nginx/access.log \
37
+ && chown -R www-data:www-data /var/lib/nginx /var/log/nginx /var/www/html \
38
+ && chmod -R 755 /var/lib/nginx /var/log/nginx /var/www/html
39
 
40
  # Remove the user directive if present
41
  RUN sed -i '/^user /d' /etc/nginx/nginx.conf