119 lines
3.7 KiB
YAML
119 lines
3.7 KiB
YAML
networks:
|
|
safeline-ce:
|
|
name: safeline-ce
|
|
driver: bridge
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1
|
|
subnet: ${SUBNET_PREFIX}.0/24
|
|
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
|
|
- /etc/localtime:/etc/localtime:ro
|
|
environment:
|
|
- POSTGRES_USER=safeline-ce
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?postgres password required}
|
|
networks:
|
|
safeline-ce:
|
|
ipv4_address: ${SUBNET_PREFIX}.2
|
|
cap_drop:
|
|
- net_raw
|
|
command: [postgres, -c, max_connections=200]
|
|
redis:
|
|
container_name: safeline-redis
|
|
restart: always
|
|
image: redis:7.0.10
|
|
volumes:
|
|
- ${SAFELINE_DIR}/resources/redis/data:/data
|
|
- /etc/localtime:/etc/localtime:ro
|
|
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
|
|
networks:
|
|
safeline-ce:
|
|
ipv4_address: ${SUBNET_PREFIX}.3
|
|
cap_drop:
|
|
- net_raw
|
|
sysctls:
|
|
net.core.somaxconn: "511"
|
|
management:
|
|
container_name: safeline-mgt-api
|
|
restart: always
|
|
image: chaitin/safeline-mgt-api:${IMAGE_TAG:?image tag required}
|
|
volumes:
|
|
- ${SAFELINE_DIR?safeline dir required}/resources/management:/resources/management
|
|
- ${SAFELINE_DIR}/resources/nginx:/resources/nginx
|
|
- ${SAFELINE_DIR}/logs:/logs
|
|
- /etc/localtime:/etc/localtime:ro
|
|
ports:
|
|
- ${MGT_PORT:-9443}:1443
|
|
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
|
|
- REDIS_URL=redis://:${REDIS_PASSWORD}@safeline-redis:6379/0
|
|
- MANAGEMENT_LOGS_DIR=/logs/management
|
|
dns: 223.5.5.5
|
|
networks:
|
|
safeline-ce:
|
|
ipv4_address: ${SUBNET_PREFIX}.4
|
|
cap_drop:
|
|
- net_raw
|
|
detector:
|
|
container_name: safeline-detector
|
|
restart: always
|
|
image: chaitin/safeline-detector:${IMAGE_TAG}
|
|
volumes:
|
|
- ${SAFELINE_DIR}/resources/detector:/resources/detector
|
|
- ${SAFELINE_DIR}/logs/detector:/logs/detector
|
|
- /etc/localtime:/etc/localtime:ro
|
|
environment:
|
|
- LOG_DIR=/logs/detector
|
|
networks:
|
|
safeline-ce:
|
|
ipv4_address: ${SUBNET_PREFIX}.5
|
|
cap_drop:
|
|
- net_raw
|
|
mario:
|
|
container_name: safeline-mario
|
|
restart: always
|
|
image: chaitin/safeline-mario:${IMAGE_TAG}
|
|
volumes:
|
|
- ${SAFELINE_DIR}/resources/mario:/resources/mario
|
|
- ${SAFELINE_DIR}/logs/mario:/logs/mario
|
|
- /etc/localtime:/etc/localtime:ro
|
|
environment:
|
|
- LOG_DIR=/logs/mario
|
|
- GOGC=100
|
|
- DATABASE_URL=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-postgres/safeline-ce
|
|
- REDIS_URL=redis://:${REDIS_PASSWORD}@safeline-redis:6379/0
|
|
networks:
|
|
safeline-ce:
|
|
ipv4_address: ${SUBNET_PREFIX}.6
|
|
cap_drop:
|
|
- net_raw
|
|
tengine:
|
|
container_name: safeline-tengine
|
|
restart: always
|
|
image: chaitin/safeline-tengine:${IMAGE_TAG}
|
|
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
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- ${SAFELINE_DIR}/resources/cache:/usr/local/nginx/cache
|
|
- /etc/resolv.conf:/etc/resolv.conf
|
|
environment:
|
|
- MGT_ADDR=${SUBNET_PREFIX}.4:9002
|
|
ulimits:
|
|
nofile: 131072
|
|
network_mode: host
|