Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +48 -0
Dockerfile
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official FEniCS project Docker image as the base
|
| 2 |
+
FROM quay.io/fenicsproject/stable:latest
|
| 3 |
+
|
| 4 |
+
# Set environment variables for non-interactive installation
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# Update package lists and install necessary system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
python3-pip \
|
| 10 |
+
python3-dev \
|
| 11 |
+
build-essential \
|
| 12 |
+
libgl1-mesa-glx \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# Upgrade pip to the latest version
|
| 16 |
+
RUN pip3 install --upgrade pip
|
| 17 |
+
|
| 18 |
+
# Install Python dependencies
|
| 19 |
+
RUN pip3 install --no-cache-dir \
|
| 20 |
+
gradio \
|
| 21 |
+
pandas \
|
| 22 |
+
numpy \
|
| 23 |
+
scikit-learn \
|
| 24 |
+
sympy \
|
| 25 |
+
matplotlib \
|
| 26 |
+
fenics
|
| 27 |
+
|
| 28 |
+
# Create a directory for the app
|
| 29 |
+
WORKDIR /app
|
| 30 |
+
|
| 31 |
+
# Copy the application code into the Docker image
|
| 32 |
+
COPY app.py /app/
|
| 33 |
+
|
| 34 |
+
# (Optional) If you have other files like requirements.txt, include them
|
| 35 |
+
# COPY requirements.txt /app/
|
| 36 |
+
|
| 37 |
+
# Expose the port that Gradio will run on
|
| 38 |
+
EXPOSE 7860
|
| 39 |
+
|
| 40 |
+
# Set environment variables for Gradio to ensure it listens on all network interfaces
|
| 41 |
+
ENV GRADIO_SERVER_NAME=0.0.0.0
|
| 42 |
+
ENV GRADIO_SERVER_PORT=7860
|
| 43 |
+
|
| 44 |
+
# (Optional) If using a specific user, switch to that user
|
| 45 |
+
# USER your_username
|
| 46 |
+
|
| 47 |
+
# Define the command to run the application
|
| 48 |
+
CMD ["python3", "app.py"]
|