Skip to content

Commit

Permalink
docker: fix volume issues..
Browse files Browse the repository at this point in the history
  • Loading branch information
kaos committed Dec 15, 2015
1 parent f93a72d commit d703d8f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions 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

0 comments on commit d703d8f

Please sign in to comment.