Skip to content

Commit 2db766f

Browse files
evibhmSamueli924
authored andcommitted
fix: dns error in docker & minimize docker image size
1 parent f5db7f5 commit 2db766f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
FROM python:3.9
1+
FROM python:3.9-alpine as builder
2+
RUN apk update && apk add gcc musl-dev linux-headers
23
COPY . /app
34
WORKDIR /app
45
RUN pip install -r requirements.txt
5-
ENTRYPOINT ["python","/app/main.py"]
6+
RUN pip install pyinstaller
7+
RUN pyinstaller -F main.py -n chaoxing
8+
9+
FROM alpine
10+
COPY --from=builder /app/dist /app
11+
WORKDIR /app
12+
CMD ["./chaoxing"]

0 commit comments

Comments
 (0)