version: '3.7'

services:

  db:
    image: postgres:14.2
    restart: always
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: example
      POSTGRES_DB: xlr
    volumes:
      - ./.docker/db/data:/var/lib/postgresql/data 
    ports: 
      - 5432:5432
    
  metrics:
    image: influxdb:2.1-alpine
    restart: always
    environment:
      - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=influx
      - DOCKER_INFLUXDB_INIT_PASSWORD=development
      - DOCKER_INFLUXDB_INIT_ORG=xillio
      - DOCKER_INFLUXDB_INIT_BUCKET=xlr
      - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=development
    volumes: 
      - ./.docker/metrics/data:/var/lib/influxdb2
    ports:
      - 8086:8086

  xlr: 
    image: xillio/link-redirector:latest
    restart: always
    ports:
      - 80:80
      - 443:443
      - 8080:8080
      - 8443:8443
    volumes: 
      - ./certs:/app/certs
      - ./config.yml:/app/config.yml
