| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- 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
- # Vite Service -- DUMMY FOR PRODUCTION MODE ------------------------------------------------------------------------
- vite:
- build:
- context: .
- dockerfile: docker/nginx/Dockerfile
- restart: no
- tty: true
- command: '/bin/sh -c ''echo Production mode! Exit!'''
- ports:
- - 5172:5172
- volumes:
- - ./public:/var/frontend
- - ./:/var/www
- - ./docker/nginx/conf.d/:/etc/nginx/conf.d/
- networks:
- - cpa-network
- #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
- # - 5172:5173
- 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
- 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:
|