services:
  db:
    image: postgres:14.1-alpine
    restart: always
    environment:
      - POSTGRES_DB=test
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    ports:
      - '5432:5432'
    volumes: 
      - db:/var/lib/postgresql/data
      - ./db-init.sql:/docker-entrypoint-initdb.d/create_tables.sql
volumes:
  db:
    driver: local