Skip to content

Commit 58458ac

Browse files
committed
MOD:优化镜像大小
1 parent 0a7eec4 commit 58458ac

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
FROM python:3
1+
FROM python:3-alpine
22

33
WORKDIR /app
44

5-
COPY . .
5+
COPY requirements.txt .
66

7-
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
8-
RUN apt-get install -y nodejs
7+
RUN apk add --update nodejs npm \
8+
&& pip install --no-cache-dir -r requirements.txt \
9+
&& rm -rf /var/cache/apk/*
910

10-
RUN pip3 install -r requirements.txt
11+
COPY . .
1112

1213
ENV THREADS=4
1314

1415
EXPOSE 8080
1516

16-
CMD gunicorn -c config/gunicorn.conf.py -w $THREADS -b :8080 main:app
17+
CMD gunicorn -c config/gunicorn.conf.py -w $THREADS -b :8080 main:app

0 commit comments

Comments
 (0)