name: ${COMPOSE_PROJECT_NAME:-egeya} services: db: image: mariadb:${MARIADB_VERSION:-10.11} restart: unless-stopped environment: MARIADB_DATABASE: ${EGEYA_DB_NAME:-egeya} MARIADB_USER: ${EGEYA_DB_USER:-egeya} MARIADB_PASSWORD_FILE: /run/secrets/db_password MARIADB_ROOT_PASSWORD_FILE: /run/secrets/db_root_password TZ: ${TZ:-UTC} command: - --character-set-server=utf8mb4 - --collation-server=utf8mb4_unicode_ci volumes: - db_data:/var/lib/mysql secrets: - db_password - db_root_password healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] interval: 10s timeout: 5s retries: 10 start_period: 20s networks: - backend php: build: context: . target: php args: EGEYA_VERSION: ${EGEYA_VERSION:-4199} EGEYA_URL: ${EGEYA_URL:-} EGEYA_SHA256: ${EGEYA_SHA256:-} image: ${EGEYA_PHP_IMAGE:-local/egeya-php}:${EGEYA_VERSION:-4199} restart: unless-stopped depends_on: db: condition: service_healthy environment: E2_DB_SERVER: db E2_DB_USER_NAME: ${EGEYA_DB_USER:-egeya} E2_DB_PASSW_FILE: /run/secrets/db_password E2_DB_NAME: ${EGEYA_DB_NAME:-egeya} PHP_MEMORY_LIMIT: ${PHP_MEMORY_LIMIT:-512M} PHP_UPLOAD_MAX_FILESIZE: ${PHP_UPLOAD_MAX_FILESIZE:-512M} PHP_POST_MAX_SIZE: ${PHP_POST_MAX_SIZE:-1024M} PHP_MAX_EXECUTION_TIME: ${PHP_MAX_EXECUTION_TIME:-300} PHP_MAX_INPUT_TIME: ${PHP_MAX_INPUT_TIME:-300} TZ: ${TZ:-UTC} volumes: - ./data:/var/www/egeya-data secrets: - db_password healthcheck: test: - CMD - php - -r - '$$s=@fsockopen("127.0.0.1",9000,$$e,$$m,2); if(!$$s){exit(1);} fclose($$s);' interval: 15s timeout: 5s retries: 5 start_period: 20s networks: - backend nginx: build: context: . target: nginx args: EGEYA_VERSION: ${EGEYA_VERSION:-4199} EGEYA_URL: ${EGEYA_URL:-} EGEYA_SHA256: ${EGEYA_SHA256:-} image: ${EGEYA_NGINX_IMAGE:-local/egeya-nginx}:${EGEYA_VERSION:-4199} restart: unless-stopped depends_on: php: condition: service_healthy environment: NGINX_SERVER_NAME: ${NGINX_SERVER_NAME:-_} NGINX_CLIENT_MAX_BODY_SIZE: ${PHP_POST_MAX_SIZE:-1024M} NGINX_EXTERNAL_PORT: ${HTTP_PORT:-8080} ports: - "${HTTP_BIND:-127.0.0.1}:${HTTP_PORT:-8080}:80" volumes: - ./data:/var/www/egeya-data:ro - ./docker/nginx/egeya.conf.template:/etc/nginx/templates/egeya.conf.template:ro networks: - frontend - backend volumes: db_data: networks: frontend: driver: bridge backend: driver: bridge internal: true secrets: db_password: file: ./secrets/db_password db_root_password: file: ./secrets/db_root_password