guohanghui commited on
Commit
5d59b15
·
verified ·
1 Parent(s): 1b77a9a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -7
Dockerfile CHANGED
@@ -1,18 +1,33 @@
1
- # Install Cython and build dependencies first
2
- RUN pip install --no-cache-dir --user cython numpy mako cyarray
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
- # Copy and install requirements
5
  COPY --chown=user ./requirements.txt requirements.txt
 
6
  RUN pip install --no-cache-dir --user -r requirements.txt
7
 
8
- # Try to install pysph from PyPI first (pre-compiled)
9
- RUN pip install --no-cache-dir --user pysph || echo "PyPI installation failed, will build from source"
10
 
11
- # Copy all source code
12
  COPY --chown=user . /app
13
 
14
- # Only build from source if PyPI installation failed
15
  WORKDIR /app/pysph/source
 
16
  RUN pip show pysph > /dev/null 2>&1 || pip install --no-cache-dir --user -e .
17
 
18
  WORKDIR /app
 
1
+ FROM python:3.10
2
+
3
+ RUN apt-get update && apt-get install -y \
4
+ build-essential \
5
+ gcc \
6
+ g++ \
7
+ gfortran \
8
+ libopenblas-dev \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ RUN useradd -m -u 1000 user
12
+
13
+ USER user
14
+
15
+ ENV PATH="/home/user/.local/bin:$PATH"
16
+
17
+ WORKDIR /app
18
+
19
+ RUN pip install --no-cache-dir --user --upgrade pip cython numpy mako cyarray
20
 
 
21
  COPY --chown=user ./requirements.txt requirements.txt
22
+
23
  RUN pip install --no-cache-dir --user -r requirements.txt
24
 
25
+ RUN pip install --no-cache-dir --user pysph || echo "Will build from source"
 
26
 
 
27
  COPY --chown=user . /app
28
 
 
29
  WORKDIR /app/pysph/source
30
+
31
  RUN pip show pysph > /dev/null 2>&1 || pip install --no-cache-dir --user -e .
32
 
33
  WORKDIR /app