services:
  app:
    build:
      context: .
      dockerfile: docker/Dockerfile
    restart: unless-stopped
    working_dir: /var/www
    volumes:
      - .:/var/www
    networks:
      - onpsc

  web:
    image: nginx:alpine
    restart: unless-stopped
    ports:
      - "8086:80"
    volumes:
      - .:/var/www
      - ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
    networks:
      - onpsc

  db:
    image: mysql:8.0
    restart: unless-stopped
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_DATABASE: untref_onpsc
      MYSQL_USER: untref_autoadmin
      MYSQL_PASSWORD: "UeOk]M7#wUs%"
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - dbdata:/var/lib/mysql
      - ./untref_onpsc.sql:/docker-entrypoint-initdb.d/init.sql
    networks:
      - onpsc

networks:
  onpsc:
    driver: bridge

volumes:
  dbdata:
