Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +23 -22
Dockerfile
CHANGED
@@ -1,22 +1,23 @@
|
|
1 |
-
# Build stage
|
2 |
-
FROM python:3.
|
3 |
-
|
4 |
-
WORKDIR /app
|
5 |
-
|
6 |
-
COPY requirements.txt requirements.txt
|
7 |
-
RUN
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
COPY
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
1 |
+
# Build stage
|
2 |
+
FROM python:3.10-slim-buster AS build
|
3 |
+
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
COPY requirements.txt requirements.txt
|
7 |
+
RUN apt-get update && \
|
8 |
+
apt-get install -y --no-install-recommends build-essential libffi-dev cmake libcurl4-openssl-dev && \
|
9 |
+
pip3 install --user --no-cache-dir -r requirements.txt
|
10 |
+
|
11 |
+
COPY . .
|
12 |
+
|
13 |
+
# Production stage
|
14 |
+
FROM python:3.10-slim-buster AS production
|
15 |
+
|
16 |
+
WORKDIR /app
|
17 |
+
|
18 |
+
COPY --from=build /root/.local /root/.local
|
19 |
+
COPY . .
|
20 |
+
|
21 |
+
ENV PATH=/root/.local/bin:$PATH
|
22 |
+
|
23 |
+
CMD ["python3", "./run.py"]
|