Files
SafeLine/compose.yaml

126 lines
3.8 KiB
YAML
Raw Normal View History

2023-04-11 14:22:23 +08:00
networks:
safeline-ce:
name: safeline-ce
driver: bridge
ipam:
driver: default
config:
2023-05-10 17:43:20 +08:00
- gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1
subnet: ${SUBNET_PREFIX}.0/24
2023-04-11 14:22:23 +08:00
driver_opts:
com.docker.network.bridge.name: safeline-ce
services:
postgres:
container_name: safeline-postgres
restart: always
image: postgres:15.2
volumes:
- ${SAFELINE_DIR}/resources/postgres/data:/var/lib/postgresql/data
2023-04-27 18:24:01 +08:00
- /etc/localtime:/etc/localtime:ro
2023-04-11 14:22:23 +08:00
environment:
- POSTGRES_USER=safeline-ce
2023-04-15 13:36:11 +08:00
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?postgres password required}
2023-04-11 14:22:23 +08:00
networks:
safeline-ce:
2023-05-10 17:43:20 +08:00
ipv4_address: ${SUBNET_PREFIX}.2
2023-04-11 14:22:23 +08:00
cap_drop:
- net_raw
command: [postgres, -c, max_connections=200]
2023-06-07 17:35:10 +08:00
redis:
container_name: safeline-redis
restart: always
image: redis:7.0.10
2023-06-07 17:35:10 +08:00
volumes:
- ${SAFELINE_DIR}/resources/redis/data:/data
- /etc/localtime:/etc/localtime:ro
2023-06-26 20:58:30 +08:00
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
2023-06-07 17:35:10 +08:00
networks:
safeline-ce:
ipv4_address: ${SUBNET_PREFIX}.3
cap_drop:
- net_raw
sysctls:
net.core.somaxconn: "511"
2023-04-11 14:22:23 +08:00
management:
container_name: safeline-mgt-api
restart: always
2023-04-15 13:36:11 +08:00
image: chaitin/safeline-mgt-api:${IMAGE_TAG:?image tag required}
2023-04-11 14:22:23 +08:00
volumes:
2023-05-05 15:47:54 +08:00
- ${SAFELINE_DIR?safeline dir required}/resources/management:/resources/management
- ${SAFELINE_DIR}/resources/nginx:/resources/nginx
- ${SAFELINE_DIR}/logs:/logs
2023-04-11 14:22:23 +08:00
- /etc/localtime:/etc/localtime:ro
ports:
- ${MGT_PORT:-9443}:1443
2023-04-11 14:22:23 +08:00
environment:
- MANAGEMENT_RESOURCES_DIR=/resources/management
- NGINX_RESOURCES_DIR=/resources/nginx
- DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce
- MARIO_URL=http://safeline-mario:3335
- DETECTOR_URL=http://safeline-detector:8001
2023-08-03 17:30:20 +08:00
- REDIS_URL=redis://:${REDIS_PASSWORD}@safeline-redis:6379/0
2023-04-11 14:22:23 +08:00
- MANAGEMENT_LOGS_DIR=/logs/management
2023-09-12 15:23:48 +08:00
dns:
- 119.29.29.29
- 223.5.5.5
- 180.76.76.76
- 1.2.4.8
- 114.114.114.114
- 8.8.8.8
2023-04-11 14:22:23 +08:00
networks:
safeline-ce:
2023-05-10 17:43:20 +08:00
ipv4_address: ${SUBNET_PREFIX}.4
2023-04-11 14:22:23 +08:00
cap_drop:
- net_raw
detector:
container_name: safeline-detector
restart: always
image: chaitin/safeline-detector:${IMAGE_TAG}
2023-04-11 14:22:23 +08:00
volumes:
- ${SAFELINE_DIR}/resources/detector:/resources/detector
- ${SAFELINE_DIR}/logs/detector:/logs/detector
2023-04-27 18:24:01 +08:00
- /etc/localtime:/etc/localtime:ro
2023-04-11 14:22:23 +08:00
environment:
- LOG_DIR=/logs/detector
networks:
safeline-ce:
2023-05-10 17:43:20 +08:00
ipv4_address: ${SUBNET_PREFIX}.5
2023-04-11 14:22:23 +08:00
cap_drop:
- net_raw
mario:
container_name: safeline-mario
restart: always
image: chaitin/safeline-mario:${IMAGE_TAG}
2023-04-11 14:22:23 +08:00
volumes:
- ${SAFELINE_DIR}/resources/mario:/resources/mario
- ${SAFELINE_DIR}/logs/mario:/logs/mario
2023-04-27 18:24:01 +08:00
- /etc/localtime:/etc/localtime:ro
2023-04-11 14:22:23 +08:00
environment:
- LOG_DIR=/logs/mario
- GOGC=100
2023-05-10 17:43:20 +08:00
- DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce
2023-06-26 20:58:30 +08:00
- REDIS_URL=redis://:${REDIS_PASSWORD}@safeline-redis:6379/0
2023-04-11 14:22:23 +08:00
networks:
safeline-ce:
2023-05-10 17:43:20 +08:00
ipv4_address: ${SUBNET_PREFIX}.6
2023-04-11 14:22:23 +08:00
cap_drop:
- net_raw
tengine:
container_name: safeline-tengine
restart: always
image: chaitin/safeline-tengine:${IMAGE_TAG}
2023-04-11 14:22:23 +08:00
volumes:
- ${SAFELINE_DIR}/resources/nginx:/etc/nginx
- ${SAFELINE_DIR}/resources/management:/resources/management
- ${SAFELINE_DIR}/resources/detector:/resources/detector
- ${SAFELINE_DIR}/logs/nginx:/var/log/nginx
2023-04-11 14:22:23 +08:00
- /etc/localtime:/etc/localtime:ro
- ${SAFELINE_DIR}/resources/cache:/usr/local/nginx/cache
2023-04-11 14:22:23 +08:00
- /etc/resolv.conf:/etc/resolv.conf
2023-04-27 18:24:01 +08:00
environment:
2023-05-10 17:43:20 +08:00
- MGT_ADDR=${SUBNET_PREFIX}.4:9002
2023-04-11 14:22:23 +08:00
ulimits:
nofile: 131072
2023-06-26 20:58:30 +08:00
network_mode: host