docs(docker-compose): Update README.md with example directory structure
This commit is contained in:
parent
9ef85a53e6
commit
de2b657ec1
@ -11,7 +11,7 @@ When everything's ready start Grafana with Docker Compose, otherwise head down t
|
|||||||
## Environment
|
## Environment
|
||||||
```
|
```
|
||||||
export COMPOSE_DIR='/opt/containers/grafana'
|
export COMPOSE_DIR='/opt/containers/grafana'
|
||||||
export COMPOSE_CTX='cncf'
|
export COMPOSE_CTX='ux_vilnius'
|
||||||
export COMPOSE_PROJECT='grafana-'"${COMPOSE_CTX}"
|
export COMPOSE_PROJECT='grafana-'"${COMPOSE_CTX}"
|
||||||
export COMPOSE_FILE="${COMPOSE_DIR}"'/docker-compose.yml'
|
export COMPOSE_FILE="${COMPOSE_DIR}"'/docker-compose.yml'
|
||||||
export COMPOSE_ENV=<add accordingly>
|
export COMPOSE_ENV=<add accordingly>
|
||||||
@ -38,18 +38,43 @@ Create ZFS datasets and set permissions as needed.
|
|||||||
|
|
||||||
* Container-specific datasets
|
* Container-specific datasets
|
||||||
```
|
```
|
||||||
zfs create -p 'zpool/docker-data/grafana-${COMPOSE_CTX}/grafana/data/db'
|
zfs create -p 'zpool/docker-data/grafana-'"${COMPOSE_CTX}"'/grafana/data/db'
|
||||||
zfs create -p 'zpool/docker-data/grafana-${COMPOSE_CTX}/grafana/data/logs'
|
zfs create -p 'zpool/docker-data/grafana-'"${COMPOSE_CTX}"'/grafana/data/logs'
|
||||||
zfs create -p 'zpool/docker-data/grafana-${COMPOSE_CTX}/grafana/config'
|
zfs create -p 'zpool/docker-data/grafana-'"${COMPOSE_CTX}"'/grafana/config'
|
||||||
zfs create -p 'zpool/docker-data/grafana-${COMPOSE_CTX}/nginx/data/db'
|
zfs create -p 'zpool/docker-data/grafana-'"${COMPOSE_CTX}"'/nginx/data/db'
|
||||||
zfs create -p 'zpool/docker-data/grafana-${COMPOSE_CTX}/nginx/data/logs'
|
zfs create -p 'zpool/docker-data/grafana-'"${COMPOSE_CTX}"'/nginx/data/logs'
|
||||||
zfs create -p 'zpool/docker-data/grafana-${COMPOSE_CTX}/nginx/config'
|
zfs create -p 'zpool/docker-data/grafana-'"${COMPOSE_CTX}"'/nginx/config'
|
||||||
```
|
```
|
||||||
When changing bind mount locations to real ones remember to also update `volumes:` in [docker-compose.yml](docker-compose.yml).
|
When changing bind mount locations to real ones remember to also update `volumes:` in [docker-compose.yml](docker-compose.yml).
|
||||||
|
|
||||||
|
* Create subdirs
|
||||||
|
```
|
||||||
|
mkdir -p '/opt/docker-data/grafana-'"${COMPOSE_CTX}"'/grafana/'{'.ssh','config','data','projects'}
|
||||||
|
```
|
||||||
|
|
||||||
* Change ownership
|
* Change ownership
|
||||||
```
|
```
|
||||||
chown -R 1000:1000 '/opt/docker-data/grafana-${COMPOSE_CTX}/grafana/data'
|
chown -R 1000:1000 '/opt/docker-data/grafana-${COMPOSE_CTX}/grafana/data'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Additional files
|
||||||
|
|
||||||
|
Place the following files on target server. Use the directory structure at [build-context](build-context) as a guide, specifically at `docker-data`.
|
||||||
|
|
||||||
|
```
|
||||||
|
build-context/
|
||||||
|
├── grafana
|
||||||
|
│ ├── docker-data
|
||||||
|
│ | └── config
|
||||||
|
│ │ └── grafana.cfg
|
||||||
|
│ ├── Dockerfile
|
||||||
|
│ └── extras
|
||||||
|
└── nginx
|
||||||
|
├── docker-data
|
||||||
|
| └── config
|
||||||
|
│ └── nginx.cfg
|
||||||
|
├── Dockerfile
|
||||||
|
└── extras
|
||||||
|
```
|
||||||
|
|
||||||
When done head back up to [How to run](#how-to-run).
|
When done head back up to [How to run](#how-to-run).
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CONTEXT=cncf
|
CONTEXT=ux_vilnius
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -10,14 +10,6 @@ CONTEXT=cncf
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# A ${LOCATION} var is usually not needed. It may be helpful when a ${CONTEXT}
|
|
||||||
# extends over more than one location e.g. to bind-mount location-specific
|
|
||||||
# config files or certificates into a container.
|
|
||||||
# ---
|
|
||||||
# LOCATION=
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Feel free to leave defaults. They apply while these vars are commented out
|
# Feel free to leave defaults. They apply while these vars are commented out
|
||||||
# ---
|
# ---
|
||||||
# RESTARTPOLICY=unless-stopped
|
# RESTARTPOLICY=unless-stopped
|
||||||
|
@ -11,7 +11,7 @@ When everything's ready start Vault with Docker Compose, otherwise head down to
|
|||||||
## Environment
|
## Environment
|
||||||
```
|
```
|
||||||
export COMPOSE_DIR='/opt/containers/hashicorpvault'
|
export COMPOSE_DIR='/opt/containers/hashicorpvault'
|
||||||
export COMPOSE_CTX='fsf'
|
export COMPOSE_CTX='ux_vilnius'
|
||||||
export COMPOSE_PROJECT='vault-'"${COMPOSE_CTX}"
|
export COMPOSE_PROJECT='vault-'"${COMPOSE_CTX}"
|
||||||
export COMPOSE_FILE="${COMPOSE_DIR}"'/docker-compose.yml'
|
export COMPOSE_FILE="${COMPOSE_DIR}"'/docker-compose.yml'
|
||||||
export COMPOSE_OVERRIDE="${COMPOSE_DIR%/}"'/docker-compose.override.yml'
|
export COMPOSE_OVERRIDE="${COMPOSE_DIR%/}"'/docker-compose.override.yml'
|
||||||
@ -45,15 +45,33 @@ Create ZFS datasets and set permissions as needed.
|
|||||||
|
|
||||||
* Container-specific datasets
|
* Container-specific datasets
|
||||||
```
|
```
|
||||||
zfs create -p 'zpool/docker-data/vault-${COMPOSE_CTX}/vault/data/db'
|
zfs create -p 'zpool/docker-data/vault-'"${COMPOSE_CTX}"'/vault/data/db'
|
||||||
zfs create -p 'zpool/docker-data/vault-${COMPOSE_CTX}/vault/data/logs'
|
zfs create -p 'zpool/docker-data/vault-'"${COMPOSE_CTX}"'/vault/data/logs'
|
||||||
zfs create -p 'zpool/docker-data/vault-${COMPOSE_CTX}/vault/config'
|
zfs create -p 'zpool/docker-data/vault-'"${COMPOSE_CTX}"'/vault/config'
|
||||||
```
|
```
|
||||||
When changing bind mount locations to real ones remember to also update `volumes:` in [docker-compose.yml](docker-compose.yml).
|
When changing bind mount locations to real ones remember to also update `volumes:` in [docker-compose.yml](docker-compose.yml).
|
||||||
|
|
||||||
|
* Create subdirs
|
||||||
|
```
|
||||||
|
mkdir -p '/opt/docker-data/vault-'"${COMPOSE_CTX}"'/vault/'{'.ssh','config','data','projects'}
|
||||||
|
```
|
||||||
|
|
||||||
* Change ownership
|
* Change ownership
|
||||||
```
|
```
|
||||||
chown -R 1000:1000 '/opt/docker-data/vault-${COMPOSE_CTX}/vault/data'
|
chown -R 1000:1000 '/opt/docker-data/vault-${COMPOSE_CTX}/vault/data'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Additional files
|
||||||
|
|
||||||
|
Place the following files on target server. Use the directory structure at [build-context](build-context) as a guide, specifically at `docker-data`.
|
||||||
|
|
||||||
|
```
|
||||||
|
build-context/
|
||||||
|
├── docker-data
|
||||||
|
│ └── config
|
||||||
|
│ └── vault.cfg
|
||||||
|
├── Dockerfile
|
||||||
|
└── extras
|
||||||
|
```
|
||||||
|
|
||||||
When done head back up to [How to run](#how-to-run).
|
When done head back up to [How to run](#how-to-run).
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
CONTEXT=fsf
|
CONTEXT=ux_vilnius
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -9,14 +9,6 @@ CONTEXT=fsf
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# A ${LOCATION} var is usually not needed. It may be helpful when a ${CONTEXT}
|
|
||||||
# extends over more than one location e.g. to bind-mount location-specific
|
|
||||||
# config files or certificates into a container.
|
|
||||||
# ---
|
|
||||||
# LOCATION=
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Feel free to leave defaults. They apply while these vars are commented out
|
# Feel free to leave defaults. They apply while these vars are commented out
|
||||||
# ---
|
# ---
|
||||||
# RESTARTPOLICY=unless-stopped
|
# RESTARTPOLICY=unless-stopped
|
||||||
|
@ -87,4 +87,38 @@ Create ZFS datasets and set permissions as needed.
|
|||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Additional files
|
||||||
|
|
||||||
|
Place the following files on target server. Use the directory structure at [build-context](build-context) as a guide, specifically at `docker-data`.
|
||||||
|
|
||||||
|
```
|
||||||
|
build-context/
|
||||||
|
{%- if ',' in cookiecutter.__component_list_slug -%}
|
||||||
|
{%- set components = cookiecutter.__component_list_slug.split(',') -%}
|
||||||
|
{%- for component in components %}
|
||||||
|
{%- if not loop.last %}
|
||||||
|
├── {{ component }}
|
||||||
|
│ ├── docker-data
|
||||||
|
│ | └── config
|
||||||
|
│ │ └── {{ component }}.cfg
|
||||||
|
│ ├── Dockerfile
|
||||||
|
│ └── extras
|
||||||
|
{%- else %}
|
||||||
|
└── {{ component }}
|
||||||
|
├── docker-data
|
||||||
|
| └── config
|
||||||
|
│ └── {{ component }}.cfg
|
||||||
|
├── Dockerfile
|
||||||
|
└── extras
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
|
{%- else %}
|
||||||
|
├── docker-data
|
||||||
|
│ └── config
|
||||||
|
│ └── {{ cookiecutter.__service_slug }}.cfg
|
||||||
|
├── Dockerfile
|
||||||
|
└── extras
|
||||||
|
{%- endif %}
|
||||||
|
```
|
||||||
|
|
||||||
When done head back up to [How to run](#how-to-run).
|
When done head back up to [How to run](#how-to-run).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user