1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

Docker best practices

- Install and remove OS and Go build deps in a single layer
- Use COPY instead of ADD
- WORKDIR now resolves ENV variables, use one
- Use VOLUMES for configuration and datastore
- Added launcher script start-inbucket.sh
- Made docker-run.sh more powerful
This commit is contained in:
James Hillyerd
2016-02-22 22:39:14 -08:00
parent 9fafbf73d0
commit f996fa2ae7
6 changed files with 116 additions and 17 deletions

View File

@@ -4,19 +4,22 @@
FROM golang:1.6-alpine
MAINTAINER James Hillyerd, @jameshillyerd
# Dependencies
RUN apk update && apk add git
# Configuration (WORKDIR doesn't support env vars)
ENV INBUCKET_SRC $GOPATH/src/github.com/jhillyerd/inbucket
ENV INBUCKET_HOME /opt/inbucket
WORKDIR /opt/inbucket
ENTRYPOINT ["bin/inbucket"]
CMD ["/etc/opt/inbucket.conf"]
WORKDIR $INBUCKET_HOME
ENTRYPOINT ["/con/context/start-inbucket.sh"]
CMD ["/con/configuration/inbucket.conf"]
# Ports: SMTP, HTTP, POP3
EXPOSE 10025 10080 10110
# Persistent Volumes, following convention at:
# https://github.com/docker/docker/issues/9277
# NOTE /con/context is also used, not exposed by default
VOLUME /con/configuration
VOLUME /con/data
# Build Inbucket
ADD . $INBUCKET_SRC/
COPY . $INBUCKET_SRC/
RUN "$INBUCKET_SRC/etc/docker/install.sh"