File size: 1,054 Bytes
3362fc0
 
 
 
2ef91ed
 
 
3362fc0
2ef91ed
3362fc0
 
 
 
 
2ef91ed
 
 
 
3362fc0
 
 
 
 
 
 
 
2ef91ed
 
 
 
 
3362fc0
2ef91ed
 
 
 
3362fc0
 
2ef91ed
3362fc0
2ef91ed
 
 
3362fc0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Alternative Dockerfile if openfoam base image continues to cause issues
# This installs OpenFOAM from scratch on Debian

FROM debian:bookworm-slim

USER root

# Install dependencies
RUN apt-get update && apt-get install -y \
    wget \
    software-properties-common \
    apt-transport-https \
    ca-certificates \
    gnupg \
    python3 \
    python3-pip \
    && rm -rf /var/lib/apt/lists/*

# Add OpenFOAM repository
RUN wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | bash

# Install OpenFOAM
RUN apt-get update && apt-get install -y \
    openfoam2312-default \
    && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy Python requirements
COPY requirements.txt .
RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt

# Copy application code
COPY server.py .

# Create OpenFOAM case directory
RUN mkdir -p /app/cases

# Expose port
EXPOSE 7860

# Source OpenFOAM environment and start server
CMD ["/bin/bash", "-c", "source /usr/lib/openfoam/openfoam2312/etc/bashrc && python3 server.py"]