refactor: switch to /mnt/dokku

This commit is contained in:
Jose Diaz-Gonzalez
2019-06-10 17:42:37 -04:00
parent 7aeb17986a
commit ecfb54c668
3 changed files with 18 additions and 18 deletions

View File

@@ -39,10 +39,10 @@ RUN \
mv /home/dokku /skel/home/dokku && \
mv /var/lib/dokku/config /skel/var/lib/dokku/config && \
mv /var/lib/dokku/data /skel/var/lib/dokku/data && \
ln -sf /mount/etc/ssh /etc/ssh && \
ln -sf /mount/home/dokku /home/dokku && \
ln -sf /mount/var/lib/dokku/config /var/lib/dokku/config && \
ln -sf /mount/var/lib/dokku/data /var/lib/dokku/data && \
ln -sf /mnt/dokku/etc/ssh /etc/ssh && \
ln -sf /mnt/dokku/home/dokku /home/dokku && \
ln -sf /mnt/dokku/var/lib/dokku/config /var/lib/dokku/config && \
ln -sf /mnt/dokku/var/lib/dokku/data /var/lib/dokku/data && \
mv /etc/my_init.d/00_regen_ssh_host_keys.sh \
/etc/my_init.d/15_regen_ssh_host_keys && \
rm /etc/nginx/sites-enabled/default && \

View File

@@ -13,16 +13,16 @@ log-fail() {
}
main() {
if [[ ! -d /mount ]]; then
log-info "Creating missing /mount"
mkdir -p /mount
if [[ ! -d /mnt/dokku ]]; then
log-info "Creating missing /mnt/dokku"
mkdir -p /mnt/dokku
fi
directories=("/etc/ssh" "/home/dokku" "/var/lib/dokku/config" "/var/lib/dokku/data")
for dir in "${directories[@]}"; do
if [[ ! -e "$dir" ]]; then
log-info "Copying ${dir} skel into place"
mkdir -p "/mount${dir}"
mkdir -p "/mnt/dokku${dir}"
rsync -a "/skel${dir}/" "${dir}/" || log-fail "Unable to copy ${dir} skel into place"
fi
@@ -32,10 +32,10 @@ main() {
fi
done
if [[ -f /mount/plugin-list ]]; then
if [[ -f /mnt/dokku/plugin-list ]]; then
while read line; do
dokku plugin:install "$(echo "$line" | awk '{print $2}')" "$(echo "$line" | cut -d':' -f1)"
done </mount/plugin-list
done </mnt/dokku/plugin-list
fi
if [[ -n "$DOKKU_HOSTNAME" ]]; then
@@ -44,12 +44,12 @@ main() {
dokku --quiet domains:set-global "$DOKKU_HOSTNAME"
fi
if [[ ! -f /mount/etc/nginx/dhparam.pem ]]; then
mkdir -p /mount/etc/nginx
openssl dhparam -out /mount/etc/nginx/dhparam.pem 2048
if [[ ! -f /mnt/dokku/etc/nginx/dhparam.pem ]]; then
mkdir -p /mnt/dokku/etc/nginx
openssl dhparam -out /mnt/dokku/etc/nginx/dhparam.pem 2048
fi
cp -f /mount/etc/nginx/dhparam.pem /etc/nginx/dhparam.pem
cp -f /mnt/dokku/etc/nginx/dhparam.pem /etc/nginx/dhparam.pem
chown root:root /etc/nginx/dhparam.pem
chown root:root /etc/nginx/conf.d
}

View File

@@ -15,7 +15,7 @@ docker run \
--publish 3022:22 \
--publish 8080:80 \
--publish 8443:443 \
--volume /mount:/mount \
--volume /var/lib/dokku:/mnt/dokku \
--volume /var/run/docker.sock:/var/run/docker.sock \
dokku/dokku:v0.17.7
```
@@ -27,12 +27,12 @@ Dokku is run with the following options:
- Container SSH port 22 is exposed on the host as 3022.
- Container HTTP port 80 is exposed on the host as 8000.
- Container HTTPS port 443 is exposed on the host as 8443.
- Data within the container is stored on the host within the `/mount` directory.
- Data within the container is stored on the host within the `/var/lib/dokku` directory.
- The docker socket is mounted into container
Application repositories, plugin config, and plugin data is persisted to disk within the specified host directory for `/mount`.
Application repositories, plugin config, and plugin data is persisted to disk within the specified host directory for `/var/lib/dokku`.
To install custom plugins, create a `plugin-list` file in the host's `/mount` directory. The plugins listed herein will be automatically installed by Dokku on container boot. This file should be the following format:
To install custom plugins, create a `plugin-list` file in the host's `/var/lib/dokku` directory. The plugins listed herein will be automatically installed by Dokku on container boot. This file should be the following format:
```yaml
plugin_name: repository_url