version: "3.7"

services:
  app_proxy:
    environment:
      APP_HOST: canary_web_1
      APP_PORT: 3000
      PROXY_AUTH_WHITELIST: "/api/*"

  backend:
    image: schjonhaug/canary-backend:v1.4.0@sha256:daf6920e1f0ff781c526fa92ee0e39720dd1b18b5d7e1bcdd0aeff0cb76a68ad
    user: "1000:1000"
    restart: on-failure
    stop_grace_period: 1m
    environment:
      CANARY_NETWORK: mainnet
      CANARY_ELECTRUM_URL: tcp://$APP_ELECTRS_NODE_IP:$APP_ELECTRS_NODE_PORT
      CANARY_BIND_ADDRESS: 0.0.0.0:3001
      CANARY_DATA_DIR: /app/data
      CANARY_MODE: "self-hosted"
      CANARY_SYNC_INTERVAL: 60
      CANARY_MEMPOOL_PORT: ${APP_CANARY_MEMPOOL_PORT:-}
    volumes:
      - ${APP_DATA_DIR}/data:/app/data

  web:
    image: schjonhaug/canary-frontend:v1.4.0@sha256:5c273df8bf4dc16af0edc8f6d48519ecffb4a76b49ad8eb0cef99259c6188511
    user: "1000:1000"
    restart: on-failure
    stop_grace_period: 1m
    environment:
      API_URL: http://canary_backend_1:3001
    depends_on:
      - backend
