version: '3.8'
services:
  obig-database:
    platform: linux/amd64
    image: mysql:8.0
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_ROOT_PASSWORD: HNU0IxHqNE5zPiXy
      MYSQL_DATABASE: obig
      MYSQL_USER: obig
      MYSQL_PASSWORD: symfony
    ports:
      - '4306:3306'
    volumes:
      - ./mysql:/var/lib/mysql

  obig-phpmyadmin:
    image: phpmyadmin:latest
    ports:
      - 8080:80
    environment:
      PMA_HOST: obig-database
      PMA_PASSWORD: HNU0IxHqNE5zPiXy
      UPLOAD_LIMIT: 1000M

    restart: unless-stopped
    depends_on:
      - obig-database

  obig:
    build: ./
    ports:
      - 8090:8000
    volumes:
      - ./:/var/www/obig
    depends_on:
      - obig-database

  obig-nginx:
    image: nginx:stable-alpine
    ports:
      - '80:80'
    volumes:
      - ./:/var/www/obig
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
    tty: true
    depends_on:
      - obig
      - obig-database
      - obig-phpmyadmin

###> doctrine/doctrine-bundle ###
  database:
    image: postgres:${POSTGRES_VERSION:-15}-alpine
    environment:
      POSTGRES_DB: ${POSTGRES_DB:-app}
      # You should definitely change the password in production
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
      POSTGRES_USER: ${POSTGRES_USER:-app}
    volumes:
      - database_data:/var/lib/postgresql/data:rw
      # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
      # - ./docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###

volumes:
###> doctrine/doctrine-bundle ###
  database_data:
###< doctrine/doctrine-bundle ###
