version: '3.8'
services:
  nest-api:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: nest-api
    restart: always
    ports:
      - '3000:3000'
    depends_on:
      - nest-postgres
    env_file:
      - .env

  nest-postgres:
    image: postgres:14
    container_name: nest-postgres
    restart: always
    ports:
      - '5432:5432'
    env_file:
      - .env
    volumes:
      - nest-postgres:/var/lib/postgresql/data

volumes:
  nest-postgres:
    name: nest-postgres-db
