services:
  database:
    container_name: ogcore-database
    image: mariadb:10.11
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: ogcore
      MYSQL_PASSWORD: root
      MYSQL_USER: admin
    ports:
      - 3336:3306
    volumes:
      - database_data:/var/lib/mysql
    networks:
      - ogcore-network

  nginx:
    container_name: ogcore-nginx
    build:
      context: .
      dockerfile: ./docker/Dockerfile-nginx
    depends_on:
      - php
    ports:
      - 8080:80
    volumes:
      - ./public:/var/www/html/public:cached
    networks:
      - ogcore-network
    image: ogcore-nginx:static

  php:
    container_name: ogcore-php
    build:
      context: .
      dockerfile: ./docker/Dockerfile-jenkins-php
    depends_on:
      - database
    networks:
      - ogcore-network
    image: ogcore-php:static

volumes:
  database_data:

networks:
  ogcore-network:
