From 0b9dfc3b3c3b072c9c38e4cb2b295eb02dd94d2b Mon Sep 17 00:00:00 2001 From: Teck Meng Date: Mon, 3 Jun 2024 08:53:48 +0800 Subject: [PATCH] feat: ghost stack --- swarm/ghost.yml | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 swarm/ghost.yml diff --git a/swarm/ghost.yml b/swarm/ghost.yml new file mode 100644 index 0000000..9446e5c --- /dev/null +++ b/swarm/ghost.yml @@ -0,0 +1,60 @@ +volumes: + ghost_content: {} + ghost_mysql: {} +networks: + net: + driver: overlay + attachable: true + traefik-public: + external: true + +services: + ghost-db: + image: mysql:8 + security_opt: + - seccomp:unconfined + restart: always + command: --mysql-native-password=ON + environment: + MYSQL_ROOT_PASSWORD: ${POSTGRES_PASSWORD} + volumes: + - ghost_mysql:/var/lib/mysql + expose: + - 3306 + networks: + - net + + ghost-server: + image: ghost + cap_add: + - CAP_SYS_NICE + security_opt: + - seccomp:unconfined + restart: always + depends_on: + - ghost-db + environment: + url: https://ghost.${DOMAIN} + database__client: mysql + database__connection__host: ghost-db + database__connection__user: root + database__connection__password: ${POSTGRES_PASSWORD} + database__connection__database: ghost + DOMAIN: ${DOMAIN} + volumes: + - ghost_content:/var/lib/ghost/content + expose: + - 2368 + networks: + - net + - traefik-public + deploy: + labels: + - traefik.docker.network=traefik-public + - traefik.constraint-label=traefik-public + - traefik.enable=true + - traefik.http.routers.ghost.entrypoints=https + - traefik.http.routers.ghost.rule=Host(`ghost.${DOMAIN}`) + - traefik.http.routers.ghost.tls.certresolver=le + - traefik.http.routers.ghost.service=ghost_app + - traefik.http.services.ghost_app.loadbalancer.server.port=2368 \ No newline at end of file