MurderousCoder commited on
Commit
3362fc0
·
verified ·
1 Parent(s): 471b09e

Debian Try

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -12
Dockerfile CHANGED
@@ -1,33 +1,44 @@
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
7
  RUN apt-get update && apt-get install -y \
 
 
 
 
 
8
  python3 \
9
  python3-pip \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
 
 
 
 
 
 
 
12
  # Set working directory
13
  WORKDIR /app
14
 
15
  # Copy Python requirements
16
  COPY requirements.txt .
17
- RUN pip3 install --no-cache-dir -r requirements.txt
18
 
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"]
 
1
+ # Alternative Dockerfile if openfoam base image continues to cause issues
2
+ # This installs OpenFOAM from scratch on Debian
3
+
4
+ FROM debian:bookworm-slim
5
 
 
6
  USER root
7
 
8
+ # Install dependencies
9
  RUN apt-get update && apt-get install -y \
10
+ wget \
11
+ software-properties-common \
12
+ apt-transport-https \
13
+ ca-certificates \
14
+ gnupg \
15
  python3 \
16
  python3-pip \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
+ # Add OpenFOAM repository
20
+ RUN wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | bash
21
+
22
+ # Install OpenFOAM
23
+ RUN apt-get update && apt-get install -y \
24
+ openfoam2312-default \
25
+ && rm -rf /var/lib/apt/lists/*
26
+
27
  # Set working directory
28
  WORKDIR /app
29
 
30
  # Copy Python requirements
31
  COPY requirements.txt .
32
+ RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt
33
 
34
  # Copy application code
35
  COPY server.py .
36
 
37
+ # Create OpenFOAM case directory
38
+ RUN mkdir -p /app/cases
 
 
 
39
 
40
+ # Expose port
41
  EXPOSE 7860
42
 
 
43
  # Source OpenFOAM environment and start server
44
+ CMD ["/bin/bash", "-c", "source /usr/lib/openfoam/openfoam2312/etc/bashrc && python3 server.py"]