We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93a2b9b commit 8e4e7d4Copy full SHA for 8e4e7d4
Dockerfile
@@ -1,10 +1,22 @@
1
-FROM python:3.8-slim-buster
+# Build stage
2
+FROM python:3.8-alpine AS build
3
4
WORKDIR /app
5
6
COPY requirements.txt requirements.txt
-RUN pip3 install -r requirements.txt
7
+RUN apk add --no-cache build-base && \
8
+ pip3 install --user --no-cache-dir -r requirements.txt
9
10
COPY . .
11
12
+# Production stage
13
+FROM python:3.8-alpine AS production
14
+
15
+WORKDIR /app
16
17
+COPY --from=build /root/.local /root/.local
18
+COPY . .
19
20
+ENV PATH=/root/.local/bin:$PATH
21
22
CMD ["python3", "./run.py"]
docker-compose.yml
@@ -8,4 +8,4 @@ services:
context: .
dockerfile: Dockerfile
ports:
- - "1337:1337"
+ - "1338:1338"
0 commit comments