services:
  mcserver:
    build: .
    env_file:
        - .env
    ports:
      - 8081:3000
    depends_on:
      - database
    restart: on-failure
    volumes:
      - ./data/skins:/opt/skins
      - ./data/cloaks:/opt/cloaks

  database:
    image: 'postgres:15'
#    ports:
#      - 5432:5432
    volumes:
      - ./data/db:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: mcserver
      POSTGRES_PASSWORD: GENERATE_A_STRONG_PASSWORD_HERE
      POSTGRES_DB: mcserver
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "mcserver"]
