services:
  shlink:
    image: shlinkio/shlink:5.0
    container_name: shlink
    restart: always
    ports:
      - "8085:8080"
    environment:
      DEFAULT_DOMAIN: ${SHLINK_DOMAIN}
      IS_HTTPS_ENABLED: ${SHLINK_IS_HTTPS_ENABLED}
      GEOLITE_LICENSE_KEY: ${SHLINK_GEOIP_LICENSE_KEY}
      INITIAL_API_KEY: ${SHLINK_API_KEY}
      DB_DRIVER: postgres
      DB_HOST: shlink_db
      DB_NAME: ${SHLINK_POSTGRES_DB}
      DB_USER: ${SHLINK_POSTGRES_USER}
      DB_PASSWORD: ${SHLINK_POSTGRES_PASSWORD}
    depends_on:
      - shlink_db
  shlink_db:
    image: postgres:17
    container_name: shlink_db
    restart: always
    volumes:
      - ${SHLINK_POSTGRES_DIR}:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: ${SHLINK_POSTGRES_DB}
      POSTGRES_USER: ${SHLINK_POSTGRES_USER}
      POSTGRES_PASSWORD: ${SHLINK_POSTGRES_PASSWORD}
    ports:
      - 5436:5432
