108 lines
2.7 KiB
YAML
108 lines
2.7 KiB
YAML
version: '3.8'
|
|
|
|
# Deploy with:
|
|
# docker stack deploy -c ghost.yml ghost
|
|
#
|
|
# Runs on: adder-ghost
|
|
# Three Ghost blog instances, each with its own port and MariaDB database.
|
|
# Ghost 1: port 2368, Ghost 2: port 2369, Ghost 3: port 2370
|
|
|
|
services:
|
|
ghost1:
|
|
image: ghost:5-alpine
|
|
environment:
|
|
database__client: mysql
|
|
database__connection__host: mariadb_mariadb
|
|
database__connection__port: 3306
|
|
database__connection__user: ghost1_user
|
|
database__connection__password: ${GHOST1_DB_PASSWORD}
|
|
database__connection__database: ghost1_db
|
|
url: ${GHOST1_URL:-http://localhost:2368}
|
|
ports:
|
|
- target: 2368
|
|
published: 2368
|
|
protocol: tcp
|
|
mode: host
|
|
volumes:
|
|
- ghost1_data:/var/lib/ghost/content
|
|
networks:
|
|
- overlay-net
|
|
deploy:
|
|
replicas: 1
|
|
placement:
|
|
constraints:
|
|
- node.hostname == adder-ghost
|
|
restart_policy:
|
|
condition: on-failure
|
|
delay: 5s
|
|
max_attempts: 3
|
|
|
|
ghost2:
|
|
image: ghost:5-alpine
|
|
environment:
|
|
database__client: mysql
|
|
database__connection__host: mariadb_mariadb
|
|
database__connection__port: 3306
|
|
database__connection__user: ghost2_user
|
|
database__connection__password: ${GHOST2_DB_PASSWORD}
|
|
database__connection__database: ghost2_db
|
|
url: ${GHOST2_URL:-http://localhost:2369}
|
|
server__port: 2369
|
|
ports:
|
|
- target: 2369
|
|
published: 2369
|
|
protocol: tcp
|
|
mode: host
|
|
volumes:
|
|
- ghost2_data:/var/lib/ghost/content
|
|
networks:
|
|
- overlay-net
|
|
deploy:
|
|
replicas: 1
|
|
placement:
|
|
constraints:
|
|
- node.hostname == adder-ghost
|
|
restart_policy:
|
|
condition: on-failure
|
|
delay: 5s
|
|
max_attempts: 3
|
|
|
|
ghost3:
|
|
image: ghost:5-alpine
|
|
environment:
|
|
database__client: mysql
|
|
database__connection__host: mariadb_mariadb
|
|
database__connection__port: 3306
|
|
database__connection__user: ghost3_user
|
|
database__connection__password: ${GHOST3_DB_PASSWORD}
|
|
database__connection__database: ghost3_db
|
|
url: ${GHOST3_URL:-http://localhost:2370}
|
|
server__port: 2370
|
|
ports:
|
|
- target: 2370
|
|
published: 2370
|
|
protocol: tcp
|
|
mode: host
|
|
volumes:
|
|
- ghost3_data:/var/lib/ghost/content
|
|
networks:
|
|
- overlay-net
|
|
deploy:
|
|
replicas: 1
|
|
placement:
|
|
constraints:
|
|
- node.hostname == adder-ghost
|
|
restart_policy:
|
|
condition: on-failure
|
|
delay: 5s
|
|
max_attempts: 3
|
|
|
|
volumes:
|
|
ghost1_data:
|
|
ghost2_data:
|
|
ghost3_data:
|
|
|
|
networks:
|
|
overlay-net:
|
|
external: true
|
|
name: ${OVERLAY_NETWORK:-homelab-net}
|