rajkhanke commited on
Commit
547793d
·
verified ·
1 Parent(s): 42045d3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -6
Dockerfile CHANGED
@@ -23,18 +23,16 @@ RUN pip install --no-cache-dir -r requirements.txt
23
  # 7. Copy app code
24
  COPY . .
25
 
26
- # 8. Pre-create writable dirs at build time
27
- RUN mkdir -p "${UPLOAD_DIR}/pdfs" static/images \
28
- && chmod -R 777 "${UPLOAD_DIR}" static/images
29
 
30
- # 9. Make a tiny entrypoint to re-chmod in case of host mount, then launch
31
  RUN printf '#!/bin/sh\n\
32
  mkdir -p "${UPLOAD_DIR}/pdfs"\n\
33
- chmod -R 777 "${UPLOAD_DIR}" static/images\n\
34
  exec gunicorn --workers 4 --bind 0.0.0.0:7860 app:app\n' \
35
  > /entrypoint.sh \
36
  && chmod +x /entrypoint.sh
37
 
38
- # 10. Expose port & set entrypoint
39
  EXPOSE 7860
40
  ENTRYPOINT ["/entrypoint.sh"]
 
23
  # 7. Copy app code
24
  COPY . .
25
 
26
+ # 8. Pre-create uploads and static/images at build time
27
+ RUN mkdir -p "${UPLOAD_DIR}/pdfs" static/images
 
28
 
29
+ # 9. Entrypoint: just ensure the upload folder exists, then launch
30
  RUN printf '#!/bin/sh\n\
31
  mkdir -p "${UPLOAD_DIR}/pdfs"\n\
 
32
  exec gunicorn --workers 4 --bind 0.0.0.0:7860 app:app\n' \
33
  > /entrypoint.sh \
34
  && chmod +x /entrypoint.sh
35
 
36
+ # 10. Expose & run
37
  EXPOSE 7860
38
  ENTRYPOINT ["/entrypoint.sh"]