Skip to content

Commit 46b644a

Browse files
committed
feat: updated Dockerfile for multi-stages build & venv python
1 parent bbc729d commit 46b644a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
FROM ubuntu:latest
1+
FROM alpine:latest as builder
22
WORKDIR /app
3-
COPY requirements.txt requirements.txt
4-
RUN apt-get update && apt-get install -y \
5-
python3-pip \
6-
&& rm -rf /var/lib/apt/lists/*
3+
RUN apk --no-cache add python3-dev py3-pip py3-virtualenv gcc musl-dev
4+
RUN python3 -m venv /opt/venv
5+
ENV PATH "/opt/venv/bin:$PATH"
6+
COPY requirements.txt .
77
RUN pip3 install -r requirements.txt
8+
RUN pip3 show setuptools
89
COPY . .
10+
11+
FROM alpine:latest as runner
12+
RUN apk --no-cache add python3-dev
13+
WORKDIR /app
14+
COPY --from=builder /app .
15+
COPY --from=builder /opt/venv /opt/venv
16+
ENV PATH "/opt/venv/bin:$PATH"
917
CMD ["python3", "main.py", "--fingerprint", "198e9fe586114844f6a4eaca5069b41a7ed43fb5a2df84892b69826d64573e39", "--path-license", "examples/license.lic", "--path-machine", "examples/machine.lic"]

0 commit comments

Comments
 (0)