Robys01 commited on
Commit
39e8044
·
1 Parent(s): 3fcba8c

Last default attempt

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -5
Dockerfile CHANGED
@@ -1,9 +1,9 @@
1
- # Stage 1: Builder (using a full base image)
2
- FROM python:3.12 AS builder
3
 
4
  WORKDIR /app
5
 
6
- # Install build dependencies
7
  RUN apt-get update && apt-get install -y cmake g++ make build-essential && rm -rf /var/lib/apt/lists/*
8
 
9
  RUN python -m venv venv
@@ -11,17 +11,25 @@ ENV VIRTUAL_ENV=/app/venv
11
  ENV PATH="$VIRTUAL_ENV/bin:$PATH"
12
 
13
  COPY requirements.txt .
 
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Stage 2: Runner (you can choose a slim image if the built wheels are portable)
17
  FROM python:3.12-slim AS runner
18
 
19
  WORKDIR /app
 
20
  COPY --from=builder /app/venv venv
21
- COPY --from=builder /app /app
 
 
 
 
 
22
 
23
  ENV VIRTUAL_ENV=/app/venv
24
  ENV PATH="$VIRTUAL_ENV/bin:$PATH"
25
 
26
  EXPOSE 7860
 
27
  CMD ["python", "app.py"]
 
1
+ # Stage 1: Builder
2
+ FROM python:3.12-slim AS builder
3
 
4
  WORKDIR /app
5
 
6
+ # Install system build dependencies
7
  RUN apt-get update && apt-get install -y cmake g++ make build-essential && rm -rf /var/lib/apt/lists/*
8
 
9
  RUN python -m venv venv
 
11
  ENV PATH="$VIRTUAL_ENV/bin:$PATH"
12
 
13
  COPY requirements.txt .
14
+
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Stage 2: Runner
18
  FROM python:3.12-slim AS runner
19
 
20
  WORKDIR /app
21
+
22
  COPY --from=builder /app/venv venv
23
+
24
+ COPY app.py .
25
+ COPY models.py .
26
+ COPY test_functions.py .
27
+
28
+ COPY assets/ assets/
29
 
30
  ENV VIRTUAL_ENV=/app/venv
31
  ENV PATH="$VIRTUAL_ENV/bin:$PATH"
32
 
33
  EXPOSE 7860
34
+
35
  CMD ["python", "app.py"]