services: nginx: image: nginx:alpine container_name: crmchat-nginx ports: - "${NGINX_PORT:-80}:80" volumes: - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro - ./crmchat/public:/var/www/html/public:ro depends_on: php: condition: service_started restart: unless-stopped php: build: context: ./docker/php args: PHP_BASE_IMAGE: php:7.4-cli COMPOSER_IMAGE: composer:latest container_name: crmchat-php volumes: - ./crmchat:/var/www/html - php_runtime:/var/www/html/runtime environment: APP_DEBUG: "${APP_DEBUG:-true}" APP_KEY: "${APP_KEY:-}" DEFAULT_TIMEZONE: "${DEFAULT_TIMEZONE:-Asia/Shanghai}" DB_HOSTNAME: "${DB_HOSTNAME:-mysql}" DB_DATABASE: "${DB_DATABASE:-crmeb_chat}" DB_USERNAME: "${DB_USERNAME:-root}" DB_PASSWORD: "${DB_PASSWORD:-root}" DB_PORT: "${DB_PORT:-3306}" REDIS_HOSTNAME: "${REDIS_HOSTNAME:-redis}" REDIS_PORT: "${REDIS_PORT:-6379}" REDIS_PASSWORD: "${REDIS_PASSWORD:-}" SWOOLE_HOST: "0.0.0.0" SWOOLE_PORT: "20108" depends_on: mysql: condition: service_healthy redis: condition: service_started restart: unless-stopped mysql: image: mysql:5.7 container_name: crmchat-mysql environment: MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:-root}" MYSQL_DATABASE: "${DB_DATABASE:-crmeb_chat}" volumes: - mysql_data:/var/lib/mysql command: - --character-set-server=utf8mb4 - --collation-server=utf8mb4_unicode_ci - --default-authentication-plugin=mysql_native_password healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-root}"] interval: 5s timeout: 5s retries: 10 restart: unless-stopped redis: image: redis:alpine container_name: crmchat-redis volumes: - redis_data:/data restart: unless-stopped volumes: mysql_data: name: crmchat_mysql_data redis_data: name: crmchat_redis_data php_runtime: name: crmchat_php_runtime