version: '3.8'

services:
  editor:
    build: .
    container_name: webeditor
    ports:
      - "8081:80"
      - "3000:3000"
    env_file: .env
    environment:
      - EDITOR_SERVER_DOMAIN=${EDITOR_SERVER_DOMAIN}
      - SITES_DOMAIN_NAME=${SITES_DOMAIN_NAME}
      - SERVER_ADMIN=${SERVER_ADMIN}
      - SERVER_ENV=${SERVER_ENV}
    command: >
      bash -c "npm install && pm2 start ssl.app.js && a2enmod rewrite && apache2-foreground"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - .:/var/www/html
      - ./.apache:/etc/apache2/sites-available
      - ./.apache/logs:/var/log/apache2
      - /etc/letsencrypt:/etc/letsencrypt

volumes:
  app-data:


  # sudo apt install php8.2 php8.2-cli php8.2-common php8.2-mbstring php8.2-xml php8.2-mysql php8.2-curl php8.2-gd