Skip to content

Commit

Permalink
Commented Dockerfile, added .dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Sep 4, 2015
1 parent d34a263 commit eaa0449
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
Vagrantfile
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
FROM ubuntu:14.04

# Install dependencies
RUN apt-get update -y
RUN apt-get install -y openssl python-imaging python-jinja2 python-lxml libxml2-dev libxslt1-dev python-pgpdump

# Add code
WORKDIR /Mailpile
ADD . /Mailpile

RUN groupadd -r mailpile \
&& mkdir -p /mailpile-data/.gnupg \
&& useradd -r -d /mailpile-data -g mailpile mailpile
# Create users and groups
RUN groupadd -r mailpile \
&& mkdir -p /mailpile-data/.gnupg \
&& useradd -r -d /mailpile-data -g mailpile mailpile

# Add GnuPG placeholder file
RUN touch /mailpile-data/.gnupg/docker_placeholder

# Fix permissions
RUN chown -R mailpile:mailpile /Mailpile
RUN chown -R mailpile:mailpile /mailpile-data

# Run as non-privileged user
USER mailpile

# Initialize mailpile
RUN ./mp setup

# Entrypoint
CMD ./mp --www=0.0.0.0:33411 --wait
EXPOSE 33411

# Volumes
VOLUME /mailpile-data/.local/share/Mailpile
VOLUME /mailpile-data/.gnupg

0 comments on commit eaa0449

Please sign in to comment.