Merge pull request #436 from Horgix/dockerfile-improvment

Improve Dockerfile
This commit is contained in:
Guillaume Ayoub 2016-06-29 11:08:12 +02:00 committed by GitHub
commit 7a7e67106a

View File

@ -1,34 +1,27 @@
# Radicale Dockerfile
#
# VERSION 0.3.1
FROM alpine:latest FROM alpine:latest
# Base packages MAINTAINER Radicale project "radicale@librelist.com"
RUN apk update && \
apk upgrade && \
apk add python3 python3-dev build-base libffi-dev ca-certificates
# Python installation ENV VERSION 1.1.1
# pip ENV TARBALL https://github.com/Kozea/Radicale/archive/${VERSION}.tar.gz
ADD https://bootstrap.pypa.io/get-pip.py /tmp/install/
RUN python3 /tmp/install/* && \
pip install passlib bcrypt setuptools
# Radicale installation RUN apk --update --update-cache upgrade \
RUN mkdir -p /data/config && apk add \
COPY . /data/radicale python3 \
COPY config /data/config python3-dev \
RUN cd /data/radicale && python3 setup.py install build-base \
libffi-dev \
ca-certificates \
&& python3 -m ensurepip \
&& pip3 install --upgrade pip \
&& pip3 install passlib bcrypt
# User RUN wget ${TARBALL} \
RUN adduser -h /home/radicale -D radicale && \ && tar xzf ${VERSION}.tar.gz \
mkdir -p /home/radicale/.config && \ && cd Radicale-${VERSION} && python3 setup.py install \
ln -s /data/config /home/radicale/.config/radicale && \ && mkdir -p /etc/radicale \
chown -R radicale:radicale /data/config && \ && cp config /etc/radicale/config
chown -R radicale:radicale /home/radicale
USER radicale EXPOSE 5232
WORKDIR /home/radicale
CMD ["radicale", "-D", "-C", "/data/config/config"] CMD ["radicale", "-f", "-C", "/etc/radicale/config"]