version: '3.1'

services:

  db:
    container_name: postgres
    image: postgres
    restart: always
    volumes:
      - db_data:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: q
      POSTGRES_DB: oser_backend_db

  oser-backend:
    container_name: oser-backend
    build: 
      context: .
      dockerfile: Dockerfile
    restart: always
    volumes:
      - .:/var/www/oser-backend
    ports:
      - "8000:8000"
    depends_on:
      - db
  oser-frontend:
    container_name: oser-frontend 
    build: 
      context: ../oser-frontend
      dockerfile: Dockerfile    
    restart: always
    volumes:
      - .:/var/www/oser-backend
    ports:
      - "4200:4200"
volumes:
    db_data: {}