Skip to content

Commit 8e4e7d4

Browse files
committed
Fix port-forward & Add Multistage Dockerfile
1 parent 93a2b9b commit 8e4e7d4

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Dockerfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
FROM python:3.8-slim-buster
1+
# Build stage
2+
FROM python:3.8-alpine AS build
23

34
WORKDIR /app
45

56
COPY requirements.txt requirements.txt
6-
RUN pip3 install -r requirements.txt
7+
RUN apk add --no-cache build-base && \
8+
pip3 install --user --no-cache-dir -r requirements.txt
79

810
COPY . .
911

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+
1022
CMD ["python3", "./run.py"]

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ services:
88
context: .
99
dockerfile: Dockerfile
1010
ports:
11-
- "1337:1337"
11+
- "1338:1338"

0 commit comments

Comments
 (0)