version: '3.8'

# access local Hanabira app on http://localhost:8888

services:
  frontend-next:
    build:
      context: ./frontend-next
    image: coil/hanabira.org:frontend-next
    ports:
      - '127.0.0.1:3000:3000'
    environment:
      REACT_APP_HOST_IP: 'express-db'
      GA_MEASUREMENT_ID: '' # Google Analytics measurement ID 
    restart: unless-stopped
    networks:
      - hanabira-network

  express-db:
    build:
      context: ./backend/express
    image: coil/hanabira.org:express-db
    ports:
      - '127.0.0.1:8000:8000'
    environment:
      REACT_APP_HOST_IP: 'express-db'
    restart: unless-stopped
    networks:
      - hanabira-network

  flask-dynamic-db:
    build:
      context: ./backend/flask
    image: coil/hanabira.org:flask-dynamic-db
    ports:
      - '127.0.0.1:5100:5100'
    volumes:
      - ./user_db:/data/db
    restart: unless-stopped
    networks:
      - hanabira-network

  dictionary-db:
    build:
      context: ./backend/dictionary
    image: coil/hanabira.org:dictionary-db
    ports:
      - '127.0.0.1:5200:5200'
    volumes:
      - './config_dummy.json:/app/config.json'
    restart: unless-stopped
    networks:
      - hanabira-network

  nginx:
    image: nginx:latest
    ports:
      - '127.0.0.1:8888:80'
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
    restart: unless-stopped
    networks:
      - hanabira-network

volumes:
  user_db:

networks:
  hanabira-network: