Merge pull request #436 from Horgix/dockerfile-improvment
Improve Dockerfile
This commit is contained in:
commit
7a7e67106a
49
Dockerfile
49
Dockerfile
@ -1,34 +1,27 @@
|
|||||||
# Radicale Dockerfile
|
FROM alpine:latest
|
||||||
#
|
|
||||||
# VERSION 0.3.1
|
|
||||||
|
|
||||||
FROM alpine:latest
|
MAINTAINER Radicale project "radicale@librelist.com"
|
||||||
|
|
||||||
# Base packages
|
ENV VERSION 1.1.1
|
||||||
RUN apk update && \
|
ENV TARBALL https://github.com/Kozea/Radicale/archive/${VERSION}.tar.gz
|
||||||
apk upgrade && \
|
|
||||||
apk add python3 python3-dev build-base libffi-dev ca-certificates
|
|
||||||
|
|
||||||
# Python installation
|
RUN apk --update --update-cache upgrade \
|
||||||
# pip
|
&& apk add \
|
||||||
ADD https://bootstrap.pypa.io/get-pip.py /tmp/install/
|
python3 \
|
||||||
RUN python3 /tmp/install/* && \
|
python3-dev \
|
||||||
pip install passlib bcrypt setuptools
|
build-base \
|
||||||
|
libffi-dev \
|
||||||
|
ca-certificates \
|
||||||
|
&& python3 -m ensurepip \
|
||||||
|
&& pip3 install --upgrade pip \
|
||||||
|
&& pip3 install passlib bcrypt
|
||||||
|
|
||||||
# Radicale installation
|
RUN wget ${TARBALL} \
|
||||||
RUN mkdir -p /data/config
|
&& tar xzf ${VERSION}.tar.gz \
|
||||||
COPY . /data/radicale
|
&& cd Radicale-${VERSION} && python3 setup.py install \
|
||||||
COPY config /data/config
|
&& mkdir -p /etc/radicale \
|
||||||
RUN cd /data/radicale && python3 setup.py install
|
&& cp config /etc/radicale/config
|
||||||
|
|
||||||
# User
|
EXPOSE 5232
|
||||||
RUN adduser -h /home/radicale -D radicale && \
|
|
||||||
mkdir -p /home/radicale/.config && \
|
|
||||||
ln -s /data/config /home/radicale/.config/radicale && \
|
|
||||||
chown -R radicale:radicale /data/config && \
|
|
||||||
chown -R radicale:radicale /home/radicale
|
|
||||||
|
|
||||||
USER radicale
|
CMD ["radicale", "-f", "-C", "/etc/radicale/config"]
|
||||||
WORKDIR /home/radicale
|
|
||||||
|
|
||||||
CMD ["radicale", "-D", "-C", "/data/config/config"]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user