CFD PROD dc

mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.9 kB
1
Indexable
Never
version: '3'
services:
  app:
    build:
      context: docker/api
    restart: unless-stopped
    environment: 
      - DB_DATABASE=${MYSQL_DATABASE}
      - DB_USERNAME=${MYSQL_USER}
      - DB_PASSWORD=${MYSQL_PASSWORD}
      - DB_CPANEL_DATABASE=${CPANEL_MYSQL_DATABASE}
      - DB_CPANEL_USERNAME=${CPANEL_MYSQL_USER}
      - DB_CPANEL_PASSWORD=${CPANEL_MYSQL_PASSWORD}
    volumes:
      - ./core:/app
    depends_on:
      - redis
      - mysql
  
  worker:
    build:
      context: docker/worker
    restart: unless-stopped
    volumes:
      - ./docker/worker/supervisord.conf:/etc/supervisord.conf
      - ./docker/worker/worker.conf:/etc/supervisor.d/worker.ini
    environment: 
      - DB_DATABASE=${MYSQL_DATABASE}
      - DB_USERNAME=${MYSQL_USER}
      - DB_PASSWORD=${MYSQL_PASSWORD}
      - DB_CPANEL_DATABASE=${CPANEL_MYSQL_DATABASE}
      - DB_CPANEL_USERNAME=${CPANEL_MYSQL_USER}
      - DB_CPANEL_PASSWORD=${CPANEL_MYSQL_PASSWORD}
    volumes_from:
      - app
    depends_on:
      - mysql
      - redis
    command: php artisan horizon

  node:
    build:
      context: ./client
    restart: unless-stopped
    environment:
      - HOST=0.0.0.0
    volumes:
      - ./client:/app
      - /app/node_modules

  caddy:
    image: caddy:2.3.0-alpine
    restart: unless-stopped
    ports:
      - 80:80
      - 82:82
      - 443:443
    networks:
      default:
        aliases:
          - ${API_SERVER}
    logging:
      options:
        max-size: "200mb"
        max-file: "10"

    environment:
      - ADMIN_SERVER=${ADMIN_SERVER}
      - API_SERVER=${API_SERVER}
      - APP_SERVER=${APP_SERVER}
      - PMA_SERVER=${PMA_SERVER}
      - CERTIFICATE_MODE=${CERTIFICATE_MODE}
      - MAILHOG_SERVER=${MAILHOG_SERVER}
    volumes:
      - ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile
      - ./data/caddy/data:/data
      - ./data/caddy/config:/config
      - ./core:/app

  mysql:
    build:
      context: ./docker/mysql
    environment:
      - MYSQL_DATABASE=${MYSQL_DATABASE}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - CPANEL_MYSQL_DATABASE=${CPANEL_MYSQL_DATABASE}
      - CPANEL_MYSQL_USER=${CPANEL_MYSQL_USER}
      - CPANEL_MYSQL_PASSWORD=${CPANEL_MYSQL_PASSWORD}
    volumes:
    - ./data/mysql:/var/lib/mysql
    ports:
      - "${MYSQL_PORT}:3306"

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    environment:
      - PMA_HOST=mysql
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - UPLOAD_LIMIT=20M
    ports:
      - 8000:80
    depends_on:
      - mysql

  redis:
    image: redis:5.0.6-alpine3.10
    volumes:
      - ./data/redis:/data

  mailhog:
    image: mailhog/mailhog
    logging:
      driver: 'none'  # disable saving logs
    ports:
      - 1026:1025 # smtp server
      - 8026:8025 # web ui