more Dockerfile tweaking
This commit is contained in:
parent
368e3d4a85
commit
40adac68a1
@ -4,21 +4,12 @@ ENV SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt
|
|||||||
ENV BLOG_UID 1000
|
ENV BLOG_UID 1000
|
||||||
ENV BLOG_GID 1000
|
ENV BLOG_GID 1000
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& echo "http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
|
|
||||||
&& apk upgrade -a --no-cache \
|
&& apk upgrade -a --no-cache \
|
||||||
&& apk add --no-cache \
|
&& pip install -U pip \
|
||||||
lftp \
|
&& mkdir /wheels
|
||||||
make \
|
COPY requirements.txt /wheels/requirements.txt
|
||||||
tzdata \
|
|
||||||
&& cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime \
|
|
||||||
&& echo "Europe/Berlin" > /etc/timezone \
|
|
||||||
&& apk del tzdata \
|
|
||||||
&& addgroup -g $BLOG_GID blog \
|
|
||||||
&& adduser -h /home/blog -D -s /bin/sh -G blog blog \
|
|
||||||
&& chown -R $BLOG_UID:$BLOG_GID /home/blog
|
|
||||||
COPY requirements.txt .
|
|
||||||
|
|
||||||
FROM base as builder
|
FROM base as wheel_builder
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apk add --no-cache\
|
&& apk add --no-cache\
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@ -31,14 +22,24 @@ RUN set -ex \
|
|||||||
linux-headers \
|
linux-headers \
|
||||||
make \
|
make \
|
||||||
musl-dev \
|
musl-dev \
|
||||||
&& pip install -r requirements.txt
|
&& pip wheel -w /wheels -r /wheels/requirements.txt
|
||||||
|
|
||||||
FROM base
|
FROM base
|
||||||
COPY --from=builder /root/.cache /root/.cache
|
COPY --from=wheel_builder /wheels /wheels
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& pip install -r requirements.txt \
|
&& pip install -r /wheels/requirements.txt -f /wheels \
|
||||||
&& rm -rf /root/.cache \
|
&& rm -rf /root/.cache \
|
||||||
&& rm requirements.txt
|
&& rm -rf /wheels \
|
||||||
|
&& apk add --no-cache \
|
||||||
|
lftp \
|
||||||
|
make \
|
||||||
|
tzdata \
|
||||||
|
&& cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime \
|
||||||
|
&& echo "Europe/Berlin" > /etc/timezone \
|
||||||
|
&& apk del tzdata \
|
||||||
|
&& addgroup -g $BLOG_GID blog \
|
||||||
|
&& adduser -h /home/blog -D -s /bin/sh -G blog blog \
|
||||||
|
&& chown -R $BLOG_UID:$BLOG_GID /home/blog
|
||||||
USER blog
|
USER blog
|
||||||
WORKDIR /blog
|
WORKDIR /blog
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
Loading…
Reference in New Issue
Block a user