version: '3.8'

services:
  backend:
    build:
      context: ./back-end
      dockerfile: Dockerfile
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - DB_HOST=db
      - DB_PORT=8080
    depends_on:
      - db
    restart: always

  frontend:
    build:
      context: ./front-end
      dockerfile: Dockerfile
    ports:
      - "80:80"
    restart: always

  db:
    image: pocketbase/pocketbase:latest
    ports:
      - "8080:8080"
    volumes:
      - ./data:/pb_data
    restart: always