---

version: "3"

services:
  frontend:
    container_name: frontend
    restart: unless-stopped
    depends_on:
      - parcel
    build:
      context: .
      dockerfile: ./development.frontend.Dockerfile
      args:
        CUSTOM_UID: 1000
        CUSTOM_GID: 1000
    environment:
      TZ: Europe/Berlin
    ports:
      - "8000:3000"
    volumes:
      - ./public/:/app/public/:ro
      - ./robots/:/app/robots/:ro
      - ./development.Caddyfile:/app/Caddyfile:ro
  parcel:
    container_name: parcel
    restart: unless-stopped
    build:
      context: .
      dockerfile: ./development.parcel.Dockerfile
      args:
        CUSTOM_UID: 1000
        CUSTOM_GID: 1000
    volumes:
      - ./frontend/:/app/frontend/:ro
      - ./postcss.config.js:/app/postcss.config.js:ro
      - ./.postcssrc:/app/.postcssrc:ro
      - ./tailwind.config.js:/app/tailwind.config.js:ro
    expose:
      - "1234"
  backend:
    container_name: backend
    restart: unless-stopped
    depends_on:
      - frontend
      - db
    build:
      context: .
      dockerfile: ./development.backend.Dockerfile
      args:
        CUSTOM_UID: 1000
        CUSTOM_GID: 1000
    expose:
      - "3001"
    volumes:
      - ./backend/:/app/backend/:ro
      - ./requirements.txt:/app/requirements.txt:ro
    environment:
      APP_NAME: "MEDWingS"
      ADMIN_EMAIL: "admin@example.com"
      DEBUG_MODE: "true"
      POSTGRES_HOST: "db"
      POSTGRES_PORT: "5432"
      POSTGRES_DB: "medwings"
      POSTGRES_USER: "medwings"
      POSTGRES_PASSWORD: "medwings"
  db:
    image: postgres
    container_name: db
    restart: unless-stopped
    expose:
      - "5432"
    volumes:
      - ./.postgres:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: "medwings"
      POSTGRES_USER: "medwings"
      POSTGRES_PASSWORD: "medwings"
  pgweb:
    image: sosedoff/pgweb
    container_name: pgweb
    restart: unless-stopped
    depends_on:
      - db
    ports:
      - "8001:8081"
    environment:
      DATABSE_URL: "postgres://medwings:medwings@db:5432/medwings?sslmode=disable"

...
