version: "3.7"
services:
  web:
    build: .
    ports:
      - "8010:5000"

    image: "compose"

    version: '3'

services:

  beersnob_database:
    container_name: beersnob_database
    hostname: beersnob_database
    image: postgres
    volumes:
      - ./volume:/var/lib/postgresql
    environment:
      - POSTGRES_DB=beersnobdb, beersnobdb_dev
      - POSTGRES_USER=mhuls
      - POSTGRES_PASSWORD=aStrongPassword
    ports:
      - 54321:5432
    restart: unless-stopped


  beersnob_api:
    container_name: beersnob_api
    hostname: beersnob_api
    build:
      context: ./beersnob_api
      dockerfile: Dockerfile
    ports:
     - 54322:5000
    volumes:
      - ./beersnob_api/src/:/usr/src/app/
      - /usr/src/app/node_modules
    restart: unless-stopped
    environment:
      NODE_ENV: ${BEERSNOB_ENVIRONMENT}
    depends_on:
      - beersnob_database