Skip to content

Commit 254686f

Browse files
committed
rollback dockerfile
1 parent e2e2ff3 commit 254686f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Dockerfile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
FROM python:3.8-alpine
1+
# -- build dependencies with debian(multiarch) --
2+
FROM python:3.8-slim AS build
23
34
ARG PIPMIRROR=https://pypi.org/simple
5+
COPY requirements /requirements
6+
RUN pip install --timeout 30 --index $PIPMIRROR --user --no-cache-dir --no-warn-script-location -r /requirements/all.txt
7+
8+
# -- app environment(multiarch) --
9+
FROM python:3.8-alpine
410
ARG ALPINEMIRROR=dl-cdn.alpinelinux.org
511
ENV sapic_isrun=true
6-
COPY requirements /requirements
7-
RUN sed -i "s/dl-cdn.alpinelinux.org/${ALPINEMIRROR}/g" /etc/apk/repositories && \
8-
apk upgrade --no-cache && \
12+
COPY --from=build /root/.local /root/.local
13+
RUN apk upgrade --no-cache && \
914
apk add --no-cache libgcc libstdc++ gcompat && \
10-
pip install --upgrade pip && \
11-
pip install --timeout 30 --index $PIPMIRROR --user --no-cache-dir --no-warn-script-location -r /requirements/all.txt && \
12-
LOCAL_PKG="/root/.local" && \
13-
ln -sf ${LOCAL_PKG}/bin/flask ${LOCAL_PKG}/bin/gunicorn /bin/ && \
15+
pip install --no-cache-dir --user -U pip pillow && \
16+
ln -sf /root/.local/bin/flask /root/.local/bin/gunicorn /bin/ && \
1417
ln -sf $(which python) /python && \
1518
sed -i "s#$(which python)#/python#" /bin/gunicorn
1619
WORKDIR /picbed
1720
COPY src /picbed
1821
EXPOSE 9514
19-
ENTRYPOINT ["gunicorn", "app:app", "-c", "sapicd.py"]
22+
ENTRYPOINT ["gunicorn", "app:app", "-c", "sapicd.py"]

docs/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Released in 2023-1-9
1111

1212
- 修复:redis 3.x版本,cli创建用户失败,感谢 @moria
1313
- 更改:redis hmset 命令更换为 hset
14-
- 更改:dockerfile取消分阶段构建(fix pillow import error
14+
- 修复:docker pillow import error
1515

1616
v1.16.0
1717
--------

0 commit comments

Comments
 (0)