socialbox-php/docker-compose.yml

98 lines
No EOL
2.7 KiB
YAML

services:
socialbox:
container_name: socialbox
build:
context: .
dockerfile: Dockerfile
ports:
- "8085:8085"
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
networks:
- internal_network
restart: unless-stopped
volumes:
- ./socialbox/config:/etc/config
- ./socialbox/logs:/var/log
- ./socialbox/data:/etc/socialbox
environment:
# No need to change these values
LOG_LEVEL: ${LOG_LEVEL:-debug}
CONFIGLIB_PATH: /etc/config
LOGGING_DIRECTORY: /var/log
SB_MODE: automated
SB_STORAGE_PATH: /etc/socialbox
# Change these values to match your environment or update the .env file
SB_INSTANCE_DOMAIN: ${SB_DOMAIN:-localhost}
SB_INSTANCE_RPC_ENDPOINT: ${SB_RPC_ENDPOINT:-http://127.0.0.0:8085/}
SB_DATABASE_HOST: mariadb
SB_DATABASE_USERNAME: ${MYSQL_USER:-socialbox}
SB_DATABASE_PASSWORD: ${MYSQL_PASSWORD:-socialbox}
SB_DATABASE_NAME: ${MYSQL_DATABASE:-socialbox}
SB_CACHE_ENGINE: redis
SB_CACHE_HOST: redis
SB_CACHE_PASSWORD: ${REDIS_PASSWORD:-root}
healthcheck:
test: ["CMD", "curl", "-f", "-H", "Request-Type: ping", "${SB_INSTANCE_DOMAIN-http://127.0.0.0:8085/}"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
mariadb:
container_name: socialbox_mariadb
image: mariadb:10.5
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-sb_root}
MYSQL_DATABASE: ${MYSQL_DATABASE:-socialbox}
MYSQL_USER: ${MYSQL_USER:-socialbox}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-socialbox}
volumes:
- mariadb_data:/var/lib/mysql
networks:
- internal_network
expose:
- "3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "mariadb", "-u", "${MYSQL_USER:-socialbox}", "-p${MYSQL_PASSWORD:-socialbox}"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
redis:
container_name: socialbox_redis
image: redis:alpine
restart: unless-stopped
command: redis-server /usr/local/etc/redis/redis.conf --appendonly yes
volumes:
- redis_data:/data
- ./redis.conf:/usr/local/etc/redis/redis.conf
networks:
- internal_network
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-root}
REDIS_DB: 0
expose:
- "6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
volumes:
mariadb_data:
driver: local
redis_data:
driver: local
networks:
internal_network:
driver: bridge
name: socialbox_network