mirror of
https://codeberg.org/Freedium-cfd/web.git
synced 2026-03-11 09:04:37 +00:00
170 lines
4.2 KiB
YAML
170 lines
4.2 KiB
YAML
# https://blog.thelazyfox.xyz/how-to-create-healthchecks-for-docker/
|
|
|
|
version: '3.7'
|
|
|
|
services:
|
|
caddy:
|
|
build:
|
|
context: ./
|
|
dockerfile: ./DockerfileCaddy
|
|
cap_add:
|
|
- NET_ADMIN
|
|
ports:
|
|
- "6752:6752"
|
|
volumes:
|
|
- ./CaddyfileDev:/etc/caddy/Caddyfile
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
networks:
|
|
- freedium_net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://caddy:6752/ --max-time 80 --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15'"]
|
|
interval: 30s
|
|
start_period: 20s
|
|
timeout: 80s
|
|
retries: 3
|
|
restart: always
|
|
stop_grace_period: 2m
|
|
|
|
wgcf1:
|
|
image: neilpang/wgcf-docker:latest
|
|
volumes:
|
|
# - ./wgcf:/wgcf
|
|
- /lib/modules:/lib/modules
|
|
- ./scripts/entryWGCF.sh:/entry.sh
|
|
- /etc/localtime:/etc/localtime:ro
|
|
privileged: true
|
|
sysctls:
|
|
net.ipv6.conf.all.disable_ipv6: 0
|
|
cap_add:
|
|
- NET_ADMIN
|
|
# ports:
|
|
# - "9681:1080"
|
|
restart: always
|
|
healthcheck:
|
|
test: curl -fs https://www.cloudflare.com/cdn-cgi/trace | grep -q -E 'warp=(on|plus)' && exit 0 || exit 1
|
|
interval: 5s
|
|
timeout: 2s
|
|
retries: 10
|
|
|
|
dante_1:
|
|
image: shturman/dante:1.4.2
|
|
volumes:
|
|
- ./scripts/dante.config:/etc/sockd.conf
|
|
- /etc/localtime:/etc/localtime:ro
|
|
restart: always
|
|
environment:
|
|
- CFGFILE=/etc/sockd.conf
|
|
network_mode: "service:wgcf1"
|
|
depends_on:
|
|
wgcf1:
|
|
condition: service_healthy
|
|
|
|
web:
|
|
build:
|
|
context: ./
|
|
dockerfile: ./Dockerfile
|
|
command: python3 -m server server
|
|
volumes:
|
|
# - ./.env:/app/.env
|
|
# - ./server/user_data/logs:/app/server/user_data/logs
|
|
- .:/app
|
|
- ./core/medium_parser/:/app/medium_parser
|
|
- ./core/rl_string_helper/:/app/rl_string_helper
|
|
# develop:
|
|
# watch:
|
|
# - action: rebuild
|
|
# path: ./server
|
|
# target: /app/server
|
|
# - action: rebuild
|
|
# path: ./core
|
|
# target: /app/core
|
|
# - action: rebuild
|
|
# path: ./rl_string_helper
|
|
# target: /app/rl_string_helper
|
|
# - action: rebuild
|
|
# path: ./database-lib
|
|
# target: /app/database-lib
|
|
# - action: rebuild
|
|
# path: "**/requirements.txt"
|
|
# - action: rebuild
|
|
# path: "**/requirements-fast.txt"
|
|
ports:
|
|
- "7080:7080"
|
|
networks:
|
|
- freedium_net
|
|
# healthcheck:
|
|
# test: ["CMD-SHELL", "curl -f http://web:7080/ --max-time 80 --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15'"]
|
|
# interval: 30s
|
|
# start_period: 20s
|
|
# timeout: 80s
|
|
# retries: 3
|
|
# restart: always
|
|
mem_limit: 4g
|
|
stop_grace_period: 2m
|
|
|
|
# redis_service:
|
|
# image: redis:latest
|
|
# networks:
|
|
# - freedium_net
|
|
# healthcheck:
|
|
# test: ["CMD", "redis-cli", "ping"]
|
|
# interval: 30s
|
|
# start_period: 20s
|
|
# timeout: 10s
|
|
# retries: 3
|
|
# restart: always
|
|
# stop_grace_period: 2m
|
|
|
|
redis_service:
|
|
image: 'docker.dragonflydb.io/dragonflydb/dragonfly'
|
|
ulimits:
|
|
memlock: -1
|
|
# expose:
|
|
# - 6379
|
|
networks:
|
|
- freedium_net
|
|
volumes:
|
|
- dragonflydata:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 30s
|
|
start_period: 20s
|
|
timeout: 10s
|
|
retries: 3
|
|
restart: always
|
|
stop_grace_period: 2m
|
|
# mem_limit: 1g
|
|
|
|
postgres:
|
|
image: postgres:16.3-alpine3.20
|
|
networks:
|
|
- freedium_net
|
|
ports:
|
|
- 5432:5432
|
|
volumes:
|
|
# - ~/apps/postgres:/var/lib/postgresql/data
|
|
- ./postgres:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_DB=postgres
|
|
stop_grace_period: 2m
|
|
|
|
autoheal:
|
|
restart: always
|
|
image: willfarrell/autoheal
|
|
environment:
|
|
- AUTOHEAL_CONTAINER_LABEL=all
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
stop_grace_period: 2m
|
|
|
|
volumes:
|
|
caddy_data:
|
|
caddy_config:
|
|
dragonflydata:
|
|
|
|
networks:
|
|
freedium_net:
|
|
driver: bridge
|