From d703d8fe6c382ad18b8e486bdfa91147a30922ba Mon Sep 17 00:00:00 2001 From: Andreas Stenius Date: Tue, 15 Dec 2015 16:11:49 +0100 Subject: [PATCH] docker: fix volume issues.. --- Dockerfile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index c12591ba83..9442761633 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,34 @@ FROM debian MAINTAINER Andreas Stenius git@astekk.se -RUN apt-get update && apt-get install -y erlang build-essential postgresql imagemagick exif wget git && \ - useradd --system --create-home zotonic && \ +RUN apt-get update && \ + apt-get install -y erlang build-essential postgresql imagemagick exif wget git && \ + useradd --system --create-home zotonic && \ printf "# Zotonic settings \n\ local all zotonic ident \n\ host all zotonic 127.0.0.1/32 md5 \n\ host all zotonic ::1/128 md5" >> /etc/postgresql/9.4/main/pg_hba.conf && \ - /etc/init.d/postgresql start && \ + /etc/init.d/postgresql start && \ echo "CREATE USER zotonic WITH PASSWORD 'zotonic'; \ ALTER ROLE zotonic WITH CREATEDB; \ CREATE DATABASE zotonic WITH OWNER = zotonic ENCODING = 'UTF8'; \ \c zotonic \ CREATE LANGUAGE \"plpgsql\";" | su -l postgres -c psql -WORKDIR /home/zotonic EXPOSE 8000 ENV ERL_FLAGS -noinput ENTRYPOINT ["./bin/zotonic"] CMD ["debug"] -VOLUME /etc/zotonic +WORKDIR /home/zotonic ADD . /home/zotonic/ -RUN mkdir -p /etc/zotonic/config /etc/zotonic/user && \ - ln -s /etc/zotonic/config /home/zotonic/.zotonic && \ - ln -s /etc/zotonic/user /home/zotonic/user && \ - chown -LR zotonic:zotonic . + +RUN make && \ + su -l zotonic -c 'bin/zotonic configfile' && \ + mkdir /etc/zotonic && \ + mv .zotonic /etc/zotonic/config && \ + mv user /etc/zotonic/user && \ + chown -R zotonic:zotonic /home/zotonic /etc/zotonic USER zotonic -RUN make +VOLUME /etc/zotonic