federatedwiki/compose.yml

73 lines
2.5 KiB
YAML
Raw Normal View History

2021-07-17 19:57:04 +00:00
---
version: "3.8"
services:
app:
2024-02-27 17:26:07 +00:00
image: dobbs/farm:1.0.22
2023-10-08 15:57:08 +00:00
command: /bin/sh entrypoint.sh
2021-07-17 19:57:04 +00:00
volumes:
2023-08-22 16:48:13 +00:00
- "${FEDWIKI_VOLUME}:/home/node/.wiki"
2021-07-17 19:57:04 +00:00
networks:
- proxy
configs:
2023-10-08 15:57:08 +00:00
- source: entrypoint_sh_conf
target: /home/node/entrypoint.sh
- source: config_json_initial_conf
target: /home/node/initial-config/config.json
secrets:
- cookie_secret
2021-07-18 19:09:46 +00:00
environment:
- DOMAIN
- COOKIE_SECRET
- AUTHOR
2021-08-22 22:31:41 +00:00
- ADMIN_KEY
2021-07-17 19:57:04 +00:00
deploy:
2023-10-08 15:57:08 +00:00
update_config:
order: start-first
2021-07-17 19:57:04 +00:00
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
2021-07-18 19:09:46 +00:00
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`) || HostRegexp(`{subdomain:\\w+}.${DOMAIN}`)"
2021-07-17 19:57:04 +00:00
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
2021-07-18 19:09:46 +00:00
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].main=${DOMAIN}"
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].sans=*.${DOMAIN}"
2022-09-27 18:15:44 +00:00
- "traefik.http.routers.${STACK_NAME}.priority=1"
2023-08-22 17:14:04 +00:00
- "caddy=https://${DOMAIN}, https://*.${DOMAIN}, https://*.*.${DOMAIN}, https://*.*.*.${DOMAIN}"
2023-08-19 22:16:41 +00:00
- "caddy.reverse_proxy={{upstreams 3000}}"
2023-08-19 22:38:20 +00:00
- "caddy.tls.on_demand="
2022-10-18 21:28:22 +00:00
- "backupbot.backup=true"
- "backupbot.backup.path=/home/node/.wiki"
2024-02-27 17:26:07 +00:00
- "coop-cloud.${STACK_NAME}.version=2.0.3+1.0.22"
2023-10-08 15:57:08 +00:00
healthcheck:
2023-10-09 10:08:01 +00:00
test: "node -e 'var http = require(\"http\"); var options = { host : \"localhost\", port : \"3000\", timeout : 2000, path : \"/view/welcome-visitors\", headers: { \"Host\": \"${DOMAIN}\" } }; var request = http.request(options, (res)
2023-10-08 15:57:08 +00:00
=> { console.log(`STATUS: $${res.statusCode}`); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } }); request.on(\"error\", function(err) { console.log('ERROR');
process.exit(1); }); request.end();'"
interval: 10s
timeout: 2s
retries: 2
start_period: 30s
2021-07-17 19:57:04 +00:00
volumes:
fedwiki:
networks:
proxy:
external: true
2023-10-08 15:57:08 +00:00
secrets:
cookie_secret:
external: true
name: ${STACK_NAME}_cookie_secret_${SECRET_COOKIE_SECRET_VERSION}
2021-07-17 19:57:04 +00:00
configs:
2023-10-08 15:57:08 +00:00
entrypoint_sh_conf:
name: ${STACK_NAME}_entrypoint_sh_${ENTRYPOINT_SH_VERSION}
file: entrypoint.sh
config_json_initial_conf:
name: ${STACK_NAME}_config_initial_json_${CONFIG_INITIAL_JSON_VERSION}
file: config.initial.json.tmpl
2021-07-18 19:09:46 +00:00
template_driver: golang