version: "3"

services:
  httpd:
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile
    volumes:
      - ..:/workspace
    command: /bin/sh -c "while sleep 1000; do :; done"
    environment:
      - windir # Defined on Windows but not on other platforms

  db:
    image: "postgres:latest"
    ports:
      - "5432:5432"
    env_file:
      - ../backend/.env
    volumes:
      - compass-center-postgres:/var/lib/postgresql/data
      # - ./backend/init.sql:/docker-entrypoint-initdb.d/init.sql:ro

  pgadmin:
    image: dpage/pgadmin4:latest
    environment:
      PGADMIN_DEFAULT_EMAIL: admin@example.com
      PGADMIN_DEFAULT_PASSWORD: admin
    ports:
      - "5050:80"
    depends_on:
      - db

volumes:
  compass-center-postgres: