Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- 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
|
| 27 |
-
RUN mkdir -p "${UPLOAD_DIR}/pdfs" static/images
|
| 28 |
-
&& chmod -R 777 "${UPLOAD_DIR}" static/images
|
| 29 |
|
| 30 |
-
# 9.
|
| 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
|
| 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"]
|