services:
  postgres:
    image: postgres:15
    container_name: postgres-dishes
    restart: always
    environment:
      POSTGRES_USER: dishes_user
      POSTGRES_PASSWORD: dishes_password
      POSTGRES_DB: dishes_db
    volumes:
      - ./postgres_data:/var/lib/postgresql/data
  backend:
    image: prinshertog/kokenmetlisa-backend:v2-stable
    container_name: kokenmetlisa-backend
    restart: always
    environment:
      SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/dishes_db
      SPRING_DATASOURCE_USERNAME: dishes_user
      SPRING_DATASOURCE_PASSWORD: dishes_password
    depends_on:
      - postgres
    healthcheck:
      test:
        - CMD-SHELL
        - nc -z localhost 8080 || exit 1
      interval: 10s
      timeout: 5s
      retries: 3
    volumes:
      - ./files:/app/Files
  frontend:
    image: prinshertog/kokenmetlisa-frontend:v2-stable
    container_name: kokenmetlisa-frontend
    restart: always
    ports:
      - 127.0.0.1:3000:3000
    environment:
      NODE_ENV: production
      PUBLIC_BASE_URL_BACKEND: http://backend:8080
      ORIGIN: https://dev1.freedombox.be
      PUBLIC_FILE_URL: https://share.freedombox.be
      BODY_SIZE_LIMIT: 3G
    depends_on:
      backend:
        condition: service_healthy
volumes:
  postgres_data: null
networks: {}
