Dockerfile: rework config handling

- No need to run as another user, containers use user namespaces
- Make config file path FHS compliant
This commit is contained in:
Alexis 'Horgix' Chotard 2016-06-26 17:25:40 +02:00
parent cd0e4e2247
commit 906aaab8cd

View File

@ -17,21 +17,10 @@ RUN apk --update --update-cache upgrade \
RUN pip3 install passlib bcrypt RUN pip3 install passlib bcrypt
RUN mkdir -p /data/config
RUN wget ${TARBALL} \ RUN wget ${TARBALL} \
&& tar xzf ${VERSION}.tar.gz \ && tar xzf ${VERSION}.tar.gz \
&& cd Radicale-${VERSION} && python3 setup.py install && cd Radicale-${VERSION} && python3 setup.py install
COPY config /data/config COPY config /srv/radicale.conf
# User CMD ["radicale", "-D", "-C", "/srv/radicale.conf"]
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
WORKDIR /home/radicale
CMD ["radicale", "-D", "-C", "/data/config/config"]