guohanghui commited on
Commit
5f96b6a
·
verified ·
1 Parent(s): 4de14af

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -0
Dockerfile CHANGED
@@ -1,15 +1,32 @@
1
  FROM python:3.10
2
 
 
 
 
 
 
 
 
3
  RUN useradd -m -u 1000 user && python -m pip install --upgrade pip
4
  USER user
5
  ENV PATH="/home/user/.local/bin:$PATH"
6
 
7
  WORKDIR /app
8
 
 
9
  COPY --chown=user ./requirements.txt requirements.txt
10
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
 
12
  COPY --chown=user . /app
 
 
 
 
 
 
 
 
13
  ENV MCP_TRANSPORT=http
14
  ENV MCP_PORT=7860
15
 
 
1
  FROM python:3.10
2
 
3
+ # Install build dependencies as root
4
+ RUN apt-get update && apt-get install -y \
5
+ build-essential \
6
+ gcc \
7
+ g++ \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
  RUN useradd -m -u 1000 user && python -m pip install --upgrade pip
11
  USER user
12
  ENV PATH="/home/user/.local/bin:$PATH"
13
 
14
  WORKDIR /app
15
 
16
+ # Copy requirements and install dependencies first
17
  COPY --chown=user ./requirements.txt requirements.txt
18
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
 
20
+ # Copy source code
21
  COPY --chown=user . /app
22
+
23
+ # Build and install pysph from source
24
+ WORKDIR /app/pysph/source
25
+ RUN pip install --no-cache-dir -e .
26
+
27
+ # Set working directory back to /app
28
+ WORKDIR /app
29
+
30
  ENV MCP_TRANSPORT=http
31
  ENV MCP_PORT=7860
32