forked from zotonic/zotonic
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |