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