1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2026-05-14 17:43:49 +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

@@ -0,0 +1,24 @@
#!/bin/sh
# start-inbucket.sh
# description: start inbucket (runs within a docker container)
CONF_SOURCE="$INBUCKET_HOME/defaults"
CONF_TARGET="/con/configuration"
set -eo pipefail
install_default_config() {
local file="$1"
local source="$CONF_SOURCE/$file"
local target="$CONF_TARGET/$file"
if [ ! -e "$target" ]; then
echo "Installing default $file to $CONF_TARGET"
install "$source" "$target"
fi
}
install_default_config "inbucket.conf"
install_default_config "greeting.html"
exec "$INBUCKET_HOME/bin/inbucket" $*