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
MAINTAINER Radicale project "radicale@librelist.com"
# Base packages
RUN apk update && \
apk upgrade && \
apk add python3 python3-dev build-base libffi-dev ca-certificates
ENV VERSION 1.1.1
ENV TARBALL https://github.com/Kozea/Radicale/archive/${VERSION}.tar.gz
# Python installation
# pip
ADD https://bootstrap.pypa.io/get-pip.py /tmp/install/
RUN python3 /tmp/install/* && \
pip install passlib bcrypt setuptools
RUN apk --update --update-cache upgrade \
&& apk add \
python3 \
python3-dev \
build-base \
libffi-dev \
ca-certificates \
&& python3 -m ensurepip \
&& pip3 install --upgrade pip \
&& pip3 install passlib bcrypt
# Radicale installation
RUN mkdir -p /data/config
COPY . /data/radicale
COPY config /data/config
RUN cd /data/radicale && python3 setup.py install
RUN wget ${TARBALL} \
&& tar xzf ${VERSION}.tar.gz \
&& cd Radicale-${VERSION} && python3 setup.py install \
&& mkdir -p /etc/radicale \
&& cp config /etc/radicale/config
# User
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
EXPOSE 5232
USER radicale
WORKDIR /home/radicale
CMD ["radicale", "-D", "-C", "/data/config/config"]
CMD ["radicale", "-f", "-C", "/etc/radicale/config"]