services: app: build: context: . dockerfile: Dockerfile args: - UID=${UID:-1000} - GID=${GID:-1000} restart: unless-stopped tty: true environment: - SERVICE_NAME=app - SERVICE_TAGS=production volumes: - ./:/var/www - ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini networks: - cpa-network depends_on: - app-queue app-queue: build: context: . dockerfile: Dockerfile args: - UID=${UID:-1000} - GID=${GID:-1000} restart: unless-stopped tty: true command: php artisan queue:work --tries=3 environment: - SERVICE_NAME=app-queue - SERVICE_TAGS=production volumes: - ./:/var/www - ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini networks: - cpa-network depends_on: db: condition: service_healthy redis: condition: service_healthy webserver: condition: service_started websocket: condition: service_started # minio: # condition: service_healthy #Nginx Service webserver: build: context: . dockerfile: docker/nginx/Dockerfile restart: unless-stopped tty: true command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"''' ports: - ${WEB_PORT:-80}:80 volumes: - ./public:/var/frontend - ./:/var/www - ./docker/nginx/conf.d/:/etc/nginx/conf.d/ networks: - cpa-network #MySQL Service db: image: mysql:8.0 command: --default-authentication-plugin=mysql_native_password restart: unless-stopped tty: true environment: - MYSQL_DATABASE=${DB_DATABASE} - MYSQL_ROOT_PASSWORD=root - MYSQL_USER=${DB_USERNAME} - MYSQL_PASSWORD=${DB_PASSWORD} - SERVICE_TAGS=production - SERVICE_NAME=mysql - TZ=${APP_TIMEZONE} healthcheck: test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD start_period: 5s interval: 5s timeout: 5s retries: 255 volumes: - ./docker/mysql/my.cnf:/etc/my.cnf - ./docker/database:/var/lib/mysql ports: - 33061:3306 networks: - cpa-network websocket: build: context: docker/websocket dockerfile: Dockerfile restart: unless-stopped environment: - JWT_SECRET=${JWT_SECRET} - REDIS_PASSWORD=${REDIS_PASSWORD} tty: true command: '/bin/sh -c ''node server''' ports: - ${WS_PORT:-3000}:3000 networks: - cpa-network depends_on: redis: condition: service_healthy redis: image: "redis:alpine" command: redis-server --requirepass ${REDIS_PASSWORD} environment: - REDIS_REPLICATION_MODE=master networks: - cpa-network healthcheck: test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ] # minio: # image: minio/minio # volumes: # - minio-data:/data # command: server --console-address 0.0.0.0:39757 /data # environment: # - MINIO_ACCESS_KEY=root # - MINIO_SECRET_KEY=root1234 # - CONSOLE_SECURE_TLS_REDIRECT=off # networks: # - cpa-network # healthcheck: # test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] # interval: 30s # timeout: 20s # retries: 3 # # createbuckets: # image: minio/mc # entrypoint: > # /bin/sh -c " # /usr/bin/mc alias set myminio http://minio:9000 root root1234; # /usr/bin/mc mb myminio/storage --region=us-east-1; # /usr/bin/mc anonymous set public myminio/storage; # exit 0; # " # networks: # - cpa-network # depends_on: # minio: # condition: service_healthy #Docker Networks networks: cpa-network: driver: bridge name: ${COMPOSE_PROJECT_NAME}-network #Volumes #volumes: # redis: # minio-data: