forked from myxdvz/booktree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (31 loc) · 1.02 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM alpine:latest
ARG UID
ARG GID
ARG USER
ARG GROUPNAME
ENV USER=${USER}
ENV GROUPNAME=${GROUPNAME}
ENV UID=${UID}
ENV GID=${GID}
COPY . /booktree/
WORKDIR /booktree
RUN echo "**** installing system packages ****" \
&& apk update \
&& apk add --update --no-cache python3 py3-pip \
&& apk add py3-pip \
&& apk add ffmpeg \
&& ln -sf python3 /usr/bin/python \
&& mkdir -p /venv \
&& python -m venv /venv \
&& source /venv/bin/activate \
&& pip install --no-cache-dir --requirement requirements.txt \
&& pip install --upgrade pip \
&& if getent passwd ${UID} >/dev/null; then deluser $(getent passwd ${UID} | cut -d: -f1); fi \
&& if getent group ${GID} >/dev/null; then delgroup $(getent group ${GID} | cut -d: -f1); fi \
&& addgroup --system --gid ${GID} ${GROUPNAME} \
&& adduser --system --uid ${UID} --disabled-password --gecos "" --ingroup ${GROUPNAME} --no-create-home ${USER} \
&& chown -R ${UID}:${GID} /booktree
USER ${USER}
VOLUME /config
VOLUME /logs
VOLUME /data