Spaces:
Sleeping
Sleeping
Sean Carnahan
commited on
Commit
·
8e844fb
1
Parent(s):
026cb35
Fix permissions for file uploads
Browse files- Dockerfile +11 -0
Dockerfile
CHANGED
@@ -18,6 +18,7 @@ RUN mkdir -p /code/static/uploads \
|
|
18 |
&& mkdir -p /code/logs \
|
19 |
&& mkdir -p /code/external/BodybuildingPoseClassifier \
|
20 |
&& mkdir -p /code/templates \
|
|
|
21 |
&& chmod -R 777 /code/static/uploads \
|
22 |
&& chmod -R 777 /code/logs \
|
23 |
&& chmod -R 777 /code/external \
|
@@ -26,6 +27,13 @@ RUN mkdir -p /code/static/uploads \
|
|
26 |
# Copy the entire application first
|
27 |
COPY . .
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
# Verify model file exists and has correct permissions
|
30 |
RUN ls -la /code/external/BodybuildingPoseClassifier/ && \
|
31 |
chmod 644 /code/external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5
|
@@ -38,5 +46,8 @@ ENV TF_CPP_MIN_LOG_LEVEL=2
|
|
38 |
# Expose the port
|
39 |
EXPOSE 7860
|
40 |
|
|
|
|
|
|
|
41 |
# Run the application
|
42 |
CMD ["python", "app.py"]
|
|
|
18 |
&& mkdir -p /code/logs \
|
19 |
&& mkdir -p /code/external/BodybuildingPoseClassifier \
|
20 |
&& mkdir -p /code/templates \
|
21 |
+
&& chown -R nobody:nogroup /code \
|
22 |
&& chmod -R 777 /code/static/uploads \
|
23 |
&& chmod -R 777 /code/logs \
|
24 |
&& chmod -R 777 /code/external \
|
|
|
27 |
# Copy the entire application first
|
28 |
COPY . .
|
29 |
|
30 |
+
# Set correct ownership and permissions after copying
|
31 |
+
RUN chown -R nobody:nogroup /code \
|
32 |
+
&& chmod -R 777 /code/static/uploads \
|
33 |
+
&& chmod -R 777 /code/logs \
|
34 |
+
&& chmod -R 777 /code/external \
|
35 |
+
&& chmod -R 777 /code/templates
|
36 |
+
|
37 |
# Verify model file exists and has correct permissions
|
38 |
RUN ls -la /code/external/BodybuildingPoseClassifier/ && \
|
39 |
chmod 644 /code/external/BodybuildingPoseClassifier/bodybuilding_pose_classifier.h5
|
|
|
46 |
# Expose the port
|
47 |
EXPOSE 7860
|
48 |
|
49 |
+
# Run the application as non-root user
|
50 |
+
USER nobody
|
51 |
+
|
52 |
# Run the application
|
53 |
CMD ["python", "app.py"]
|