services:
  synapse:
    user: "1010:1010"
    image: "matrixdotorg/synapse:latest"
    container_name: "synapse"
    volumes:
      - "/mnt/HDD/DockerData/synapse_data/data:/data"
    environment:
      SYNAPSE_SERVER_NAME: "freedombox.be"
      SYNAPSE_REPORT_STATS: "no"
    ports:
      - "127.0.0.1:8008:8008"
    restart: unless-stopped
    networks: 
      - docker-network

# Uncomment and configure the Element service if needed
#  element:
#    image: vectorim/element-web:latest
#    restart: unless-stopped
#    volumes:
#      - "./element-config.json:/app/config.json"
#    ports:
#      - "8009:80"
#    networks: 
#      - docker-network

  postgresql:
    user: "1010:1010"
    image: postgres:latest
    restart: unless-stopped
    environment:
      POSTGRES_PASSWORD: synapse
      POSTGRES_USER: synapse_user
      POSTGRES_DB: synapse
      POSTGRES_INITDB_ARGS: "--encoding='UTF8' --lc-collate='C' --lc-ctype='C'"
    volumes:
      - "./postgres_data:/var/lib/postgresql/data"
    networks: 
      - docker-network

networks:
  docker-network:
    external: true

