sreepathi-ravikumar commited on
Commit
68430bf
·
verified ·
1 Parent(s): f9b4c3b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -13
Dockerfile CHANGED
@@ -1,22 +1,30 @@
1
  FROM python:3.11-slim
2
 
3
- # Install Rust and dependencies
4
- RUN apt update && apt install -y curl build-essential
 
 
 
 
 
 
 
 
 
5
  RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
6
  ENV PATH="/root/.cargo/bin:${PATH}"
7
 
8
- WORKDIR /code
 
9
 
10
- # Copy app and dependencies
11
- COPY app.py .
12
- COPY requirements.txt .
13
- COPY sample_rust/ ./sample_rust/
14
 
15
- # Install Python and Rust modules
16
- RUN pip install maturin
17
- RUN maturin build --release --manifest-path sample_rust/Cargo.toml
18
- RUN pip install target/wheels/*.whl
19
  RUN pip install -r requirements.txt
20
 
21
- EXPOSE 7860
22
- CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]
 
1
  FROM python:3.11-slim
2
 
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ curl \
8
+ build-essential \
9
+ libssl-dev \
10
+ pkg-config \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Install Rust using rustup
14
  RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
15
  ENV PATH="/root/.cargo/bin:${PATH}"
16
 
17
+ # Install maturin
18
+ RUN pip install maturin
19
 
20
+ # Copy your codebase
21
+ COPY . .
 
 
22
 
23
+ # Install the Rust module directly into Python env
24
+ RUN maturin develop --release --manifest-path sample_rust/Cargo.toml
25
+
26
+ # Install Python dependencies
27
  RUN pip install -r requirements.txt
28
 
29
+ # Run the app
30
+ CMD ["python", "app.py"]