MurderousCoder commited on
Commit
471b09e
·
verified ·
1 Parent(s): 2ef91ed

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM openfoam/openfoam11-paraview510
2
 
3
- # Switch to root user for installations
4
  USER root
5
 
6
  # Install Python and dependencies
@@ -19,12 +19,15 @@ RUN pip3 install --no-cache-dir -r requirements.txt
19
  # Copy application code
20
  COPY server.py .
21
 
22
- # Create OpenFOAM case directory
23
- RUN mkdir -p /app/cases
 
 
 
24
 
25
  # Hugging Face Spaces uses port 7860 by default
26
  EXPOSE 7860
27
 
 
28
  # Source OpenFOAM environment and start server
29
- # Note: Hugging Face sets PORT env variable to 7860
30
  CMD ["/bin/bash", "-c", "source /opt/openfoam11/etc/bashrc && python3 server.py"]
 
1
  FROM openfoam/openfoam11-paraview510
2
 
3
+ # CRITICAL: Stay as root to avoid Hugging Face UID issues
4
  USER root
5
 
6
  # Install Python and dependencies
 
19
  # Copy application code
20
  COPY server.py .
21
 
22
+ # Create OpenFOAM case directory with proper permissions
23
+ RUN mkdir -p /app/cases && chmod 777 /app/cases
24
+
25
+ # Fix OpenFOAM directory permissions for root user
26
+ RUN chmod -R 755 /opt/openfoam11 || true
27
 
28
  # Hugging Face Spaces uses port 7860 by default
29
  EXPOSE 7860
30
 
31
+ # Stay as root and run the server
32
  # Source OpenFOAM environment and start server
 
33
  CMD ["/bin/bash", "-c", "source /opt/openfoam11/etc/bashrc && python3 server.py"]