version: '3.7'
services:
  db:
    image: couchdb:3.2.2
    environment:
      COUCHDB_USER: "admin"
      COUCHDB_PASSWORD: "password"
      EGL_BASE_URL: ${EGL_BASE_URL}
      EGL_API_AUTH_KEY: ${EGL_API_AUTH_KEY}
    volumes:
      - ${DATABASE_DIRECTORY}:/opt/couchdb/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /root/easy-cozy/configs/local.ini:/opt/couchdb/etc/local.ini
    restart: unless-stopped
    ports:
     - 5984:5984    
    networks:
      - cozy-network

  cozy:
    image: npernoud/easy-cozy:latest-amd64
    environment:
      COZY_ADMIN_PASSPHRASE: ${COZY_ADMIN_PASSPHRASE}
      COZY_ADMIN_PASSWORD: ${COZY_ADMIN_PASSPHRASE}
      COZY_TLD: ${COZY_TLD}
    volumes:
      - ${STORAGE_DIRECTORY}:/usr/local/cozy-stack/storage
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - ./cozystack/cozy.yaml:/etc/cozy/cozy.yaml
      - ./apps_sources:/tmp/apps_sources
      - ./assets:/tmp/assets
    ports:
     - 8080:8080
    depends_on:
      - db
    logging:
      driver: loki
      options:
        loki-url: http://localhost:3100/loki/api/v1/push
    restart: unless-stopped
    networks:
      - cozy-network
      
      
networks:
  cozy-network:
