nakas commited on
Commit
475558b
·
verified ·
1 Parent(s): f7c2e11

Create dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile +54 -0
dockerfile ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
8
+ wget \
9
+ gcc \
10
+ g++ \
11
+ libgeos-dev \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Install Python dependencies
15
+ RUN pip install --no-cache-dir --upgrade pip
16
+
17
+ # Install JAX without GPU support (for CPU-only deployment)
18
+ RUN pip install --no-cache-dir \
19
+ "jax[cpu]" \
20
+ jaxlib
21
+
22
+ # Install GraphCast and its dependencies
23
+ RUN pip install --no-cache-dir \
24
+ numpy \
25
+ matplotlib \
26
+ xarray \
27
+ scipy \
28
+ haiku \
29
+ dm-haiku \
30
+ optax \
31
+ cartopy \
32
+ google-cloud-storage \
33
+ ipywidgets \
34
+ gradio>=4.0.0 \
35
+ git+https://github.com/deepmind/graphcast.git
36
+
37
+ # Workaround for cartopy crashes due to the shapely installed by default
38
+ # Same as the workaround in the original notebook
39
+ RUN pip uninstall -y shapely && \
40
+ pip install shapely --no-binary shapely
41
+
42
+ # Copy application code
43
+ COPY app.py /app/
44
+
45
+ # Set environment variables
46
+ ENV PYTHONUNBUFFERED=1
47
+ ENV GRADIO_SERVER_NAME=0.0.0.0
48
+ ENV GRADIO_SERVER_PORT=7860
49
+
50
+ # Expose port
51
+ EXPOSE 7860
52
+
53
+ # Set command
54
+ CMD ["python", "app.py"]