refactor: switch to /mnt/dokku
This commit is contained in:
@@ -39,10 +39,10 @@ RUN \
|
|||||||
mv /home/dokku /skel/home/dokku && \
|
mv /home/dokku /skel/home/dokku && \
|
||||||
mv /var/lib/dokku/config /skel/var/lib/dokku/config && \
|
mv /var/lib/dokku/config /skel/var/lib/dokku/config && \
|
||||||
mv /var/lib/dokku/data /skel/var/lib/dokku/data && \
|
mv /var/lib/dokku/data /skel/var/lib/dokku/data && \
|
||||||
ln -sf /mount/etc/ssh /etc/ssh && \
|
ln -sf /mnt/dokku/etc/ssh /etc/ssh && \
|
||||||
ln -sf /mount/home/dokku /home/dokku && \
|
ln -sf /mnt/dokku/home/dokku /home/dokku && \
|
||||||
ln -sf /mount/var/lib/dokku/config /var/lib/dokku/config && \
|
ln -sf /mnt/dokku/var/lib/dokku/config /var/lib/dokku/config && \
|
||||||
ln -sf /mount/var/lib/dokku/data /var/lib/dokku/data && \
|
ln -sf /mnt/dokku/var/lib/dokku/data /var/lib/dokku/data && \
|
||||||
mv /etc/my_init.d/00_regen_ssh_host_keys.sh \
|
mv /etc/my_init.d/00_regen_ssh_host_keys.sh \
|
||||||
/etc/my_init.d/15_regen_ssh_host_keys && \
|
/etc/my_init.d/15_regen_ssh_host_keys && \
|
||||||
rm /etc/nginx/sites-enabled/default && \
|
rm /etc/nginx/sites-enabled/default && \
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ log-fail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [[ ! -d /mount ]]; then
|
if [[ ! -d /mnt/dokku ]]; then
|
||||||
log-info "Creating missing /mount"
|
log-info "Creating missing /mnt/dokku"
|
||||||
mkdir -p /mount
|
mkdir -p /mnt/dokku
|
||||||
fi
|
fi
|
||||||
|
|
||||||
directories=("/etc/ssh" "/home/dokku" "/var/lib/dokku/config" "/var/lib/dokku/data")
|
directories=("/etc/ssh" "/home/dokku" "/var/lib/dokku/config" "/var/lib/dokku/data")
|
||||||
for dir in "${directories[@]}"; do
|
for dir in "${directories[@]}"; do
|
||||||
if [[ ! -e "$dir" ]]; then
|
if [[ ! -e "$dir" ]]; then
|
||||||
log-info "Copying ${dir} skel into place"
|
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"
|
rsync -a "/skel${dir}/" "${dir}/" || log-fail "Unable to copy ${dir} skel into place"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -32,10 +32,10 @@ main() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ -f /mount/plugin-list ]]; then
|
if [[ -f /mnt/dokku/plugin-list ]]; then
|
||||||
while read line; do
|
while read line; do
|
||||||
dokku plugin:install "$(echo "$line" | awk '{print $2}')" "$(echo "$line" | cut -d':' -f1)"
|
dokku plugin:install "$(echo "$line" | awk '{print $2}')" "$(echo "$line" | cut -d':' -f1)"
|
||||||
done </mount/plugin-list
|
done </mnt/dokku/plugin-list
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$DOKKU_HOSTNAME" ]]; then
|
if [[ -n "$DOKKU_HOSTNAME" ]]; then
|
||||||
@@ -44,12 +44,12 @@ main() {
|
|||||||
dokku --quiet domains:set-global "$DOKKU_HOSTNAME"
|
dokku --quiet domains:set-global "$DOKKU_HOSTNAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f /mount/etc/nginx/dhparam.pem ]]; then
|
if [[ ! -f /mnt/dokku/etc/nginx/dhparam.pem ]]; then
|
||||||
mkdir -p /mount/etc/nginx
|
mkdir -p /mnt/dokku/etc/nginx
|
||||||
openssl dhparam -out /mount/etc/nginx/dhparam.pem 2048
|
openssl dhparam -out /mnt/dokku/etc/nginx/dhparam.pem 2048
|
||||||
fi
|
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/dhparam.pem
|
||||||
chown root:root /etc/nginx/conf.d
|
chown root:root /etc/nginx/conf.d
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ docker run \
|
|||||||
--publish 3022:22 \
|
--publish 3022:22 \
|
||||||
--publish 8080:80 \
|
--publish 8080:80 \
|
||||||
--publish 8443:443 \
|
--publish 8443:443 \
|
||||||
--volume /mount:/mount \
|
--volume /var/lib/dokku:/mnt/dokku \
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock \
|
--volume /var/run/docker.sock:/var/run/docker.sock \
|
||||||
dokku/dokku:v0.17.7
|
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 SSH port 22 is exposed on the host as 3022.
|
||||||
- Container HTTP port 80 is exposed on the host as 8000.
|
- Container HTTP port 80 is exposed on the host as 8000.
|
||||||
- Container HTTPS port 443 is exposed on the host as 8443.
|
- 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
|
- 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
|
```yaml
|
||||||
plugin_name: repository_url
|
plugin_name: repository_url
|
||||||
|
|||||||
Reference in New Issue
Block a user