version: '3.7'

services:
  php-fpm:
    container_name: ${PROJECT_NAME}-php-fpm
    build:
      context: ./docker/php-fpm
    volumes:
      - ./app:/symfony
    restart: always
    depends_on:
      - database

  php-cli:
    build:
      context: ./docker/php-cli
    volumes:
      - ./app:/symfony
    command: sleep 10000
    container_name: ${PROJECT_NAME}-php-cli

  nginx:
    build:
      context: ./docker/nginx
    volumes:
      - ./app:/symfony
    container_name: ${PROJECT_NAME}-nginx
    restart: always
    ports:
      - "8081:80"

  database:
    image: postgres
    environment:
      POSTGRES_DB: ${POSTGRES_DB:-app}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-root}
      POSTGRES_USER: ${POSTGRES_USER:-app}
    volumes:
      - database_data:/var/lib/postgresql/data:rw
    restart: always

  minio:
    restart: always
    image: minio/minio
    ports:
      - "9000:9000"
    environment:
      MINIO_ACCESS_KEY: minio
      MINIO_SECRET_KEY: minio124
    command: server /export
    volumes:
      - minio_storage:/data

volumes:
  database_data:
  minio_storage: {}