diff options
Diffstat (limited to 'stacks/.template')
| -rw-r--r-- | stacks/.template/.container.env | 13 | ||||
| -rw-r--r-- | stacks/.template/.env | 15 | ||||
| -rw-r--r-- | stacks/.template/compose.template.yml | 43 |
3 files changed, 71 insertions, 0 deletions
diff --git a/stacks/.template/.container.env b/stacks/.template/.container.env new file mode 100644 index 0000000..511f12d --- /dev/null +++ b/stacks/.template/.container.env @@ -0,0 +1,13 @@ +# +# +# Stack Runtime Variables + +# Auth +USERNAME= +PASSWORD= + +SECRET= + +# Database +DB_USER= +ET_CETERA= diff --git a/stacks/.template/.env b/stacks/.template/.env new file mode 100644 index 0000000..4c7f7d8 --- /dev/null +++ b/stacks/.template/.env @@ -0,0 +1,15 @@ +# +# +# Stack Compose Variables + +# Namespace +_STACK= +_CONTAINER= + +# Network +_NET= + +# Volumes +_DATA_VOLUME= +_CONFIG_VOLUME= +_CUSTOM_VOLUME= diff --git a/stacks/.template/compose.template.yml b/stacks/.template/compose.template.yml new file mode 100644 index 0000000..593c968 --- /dev/null +++ b/stacks/.template/compose.template.yml @@ -0,0 +1,43 @@ +## Template compose used for each stack. +name: ${_STACK} # Explicit project name (do not rely on directory name) + +networks: + net: + name: ${_NET} + external: true # All networks SHOULD be external in production. + +volumes: + data: + name: ${_DATA_VOLUME} + external: true # All volumes SHOULD be external in production. + config: + name: ${_CONFIG_VOLUME} + external: true + custom: + name: ${_CUSTOM_VOLUME} # Custom volumes may not be external depending on the stack. + # External volumes are not required for local stack testing. + +services: + servicename: + container_name: ${_CONTAINER} # Remove if a swarm is needed. + image: somewhere/someone/container:latest + restart: unless-stopped + env_file: + # NOTE: .compose.env WILL override .env if there are overlapping values. + - .compose.env # Compose wiring defaults go here + - .env # Service env vars + volumes: + # Example bind mount (read-only) + # - ./conf:/etc/service:ro + - type: volume + source: ${_DATA_VOLUME:-data} # Must exist if external; overridden in local dev + target: /data + - type: volume + source: ${_CONFIG_VOLUME:-config} # Must exist if external; overridden in local dev + target: /config + networks: + - net + expose: + - 80 + - 9001 + - 67 |
