#Calendar implementation for the HTWK Leipzig timetable. Evaluation and display of the individual dates in iCal format.
#Copyright (C) 2024 HTWKalender support@htwkalender.de

#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU Affero General Public License for more details.

#You should have received a copy of the GNU Affero General Public License
#along with this program.  If not, see <https://www.gnu.org/licenses/>.

services:
  htwkalender-data-manager:
    build:
      dockerfile: ./data-manager/Dockerfile
      context: ./services
      target: dev  # prod
    command: "--http=0.0.0.0:8090 --dir=/htwkalender-data-manager/data/pb_data"
    #ports:
    #  - "8090:8090"
    volumes:
      - pb_data:/htwkalender-data-manager/data # for production with volume
      # - ./data-manager:/htwkalender/data # for development with bind mount from project directory
    user: "ical"

  htwkalender-ical:
    build:
      dockerfile: ./ical/Dockerfile
      context: ./services
      target: dev  # prod
    environment:
      - DATA_MANAGER_URL=htwkalender-data-manager

  htwkalender-frontend:
    build:
      dockerfile: Dockerfile
      context: ./frontend
      target: dev
    command: "npm run dev"
    # open port 8000
    ports:
      - "8000:8000"
    volumes:
      - ./frontend/src:/app/src

  rproxy:
    image: bitnami/nginx:1.25
    volumes:
      - ./reverseproxy.local.conf:/opt/bitnami/nginx/conf/nginx.conf
    depends_on:
      - htwkalender-data-manager
      - htwkalender-frontend
    ports:
      - "80:80"

volumes:
  pb_data:
