summaryrefslogtreecommitdiff
path: root/stacks/.template/compose.template.yml
diff options
context:
space:
mode:
Diffstat (limited to 'stacks/.template/compose.template.yml')
-rw-r--r--stacks/.template/compose.template.yml43
1 files changed, 43 insertions, 0 deletions
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