# ------------------------------------------------------------------------------
# Copyright (C) 2022 European Spallation Source ERIC.
# ------------------------------------------------------------------------------

version: '3.7'
services:
  naming:
    container_name: "naming"
    build: ./
    networks:
      - naming-net
    ports:
      - "8080:8080"
    depends_on:
      - postgres
    command: "java -jar /naming/naming-backend.jar"
  
  postgres:
    container_name: "postgres"
    image: "postgres:9.6.7"
    networks:
      - naming-net
    ports:
      - "5432:5432"
    environment:
      POSTGRES_DB: discs_names
      POSTGRES_USER: discs_names
      POSTGRES_PASSWORD: discs_names
      PGDATA: /var/lib/postgresql/data/pgdata
    volumes:
      - naming-data:/var/lib/postgresql/data/pgdata

volumes:
  naming-data:

networks:
  naming-net:
    driver: bridge
