services:
  backend:
    # image: goldensuneur/backend
    image: ghcr.io/theolecalvar/smart-grid/backend
    restart: no
    depends_on:
      - db

  db:
    image: postgres
    restart: no
    # set shared memory limit when using docker-compose
    shm_size: 128mb
    environment:
      POSTGRES_PASSWORD: test
      POSTGRES_USER: test
      POSTGRES_DB: test

  front:
    # image: goldensuneur/frontend
    image: ghcr.io/theolecalvar/smart-grid/frontend
    restart: no
    depends_on:
      - backend
    ports:
      - 8080:8082
    environment:
      BASE_URL: http://backend:8080
  
  windturbine:
    # image: goldensuneur/windturbine
    image: ghcr.io/theolecalvar/smart-grid/windturbine
    restart: no
    depends_on:
      - backend
    environment:
      URL: "http://backend:8080/ingress/windturbine"
      TURBINE_ID: 7
  
  solar_panel:
    # image: goldensuneur/solarpanel
    image: ghcr.io/theolecalvar/smart-grid/solarpanel
    restart: no
    depends_on:
      - backend
    environment:
      IP: "backend"
      PORT: 12345
      SOLAR_PANEL_ID: 4