volumes:
  data:

networks:
  transcendence:
    driver: bridge
  
services:
  database:
    container_name: database
    image: postgres:latest
    ports:
      - "5432:5432"
    volumes:
      - data:/var/lib/postgresql/data/pg15/
    env_file:
      - ../.env
    networks:
      - transcendence
    restart: always

  backend:
    container_name: backend
    build: ./srcs/backend
    expose:
      - "3001"
    # ports:
    #   - "3001:3001"
    depends_on:
      - database
    volumes:
      - ./srcs/backend/avatar:/app/avatar
    env_file:
      - ../.env
    networks:
      - transcendence
    restart: always

  frontend:
    container_name: frontend
    build: ./srcs/frontend/
    ports:
      - "8080:80"
    depends_on:
      - backend
    networks:
      - transcendence
    restart: always