version: "3.7"

services:
  app_proxy:
    environment:
      APP_HOST: peerswap_web_1
      APP_PORT: 1984

  web:
    image: ghcr.io/impa10r/peerswap-web:v5.0.2@sha256:1fe2ea9207699ea0d2ebe6b645baa150bbc99448cb2a05ed75c82b55e57a9fee
    user: "1000:1000"
    restart: on-failure
    stop_grace_period: 1m
    environment:
      # Приложение
      USER: peerswap
      NETWORK: $APP_BITCOIN_NETWORK
      NO_HTTPS: "true"
      # ЛНД
      LND_HOST: ${APP_LIGHTNING_NODE_IP}:${APP_LIGHTNING_NODE_GRPC_PORT}
      LND_MACAROONPATH: /home/peerswap/.lnd/data/chain/bitcoin/${APP_BITCOIN_NETWORK}/admin.macaroon
      # Элементы RPC
      ELEMENTS_USER: elements
      ELEMENTS_PORT: $APP_ELEMENTS_NODE_RPC_PORT
      ELEMENTS_HOST: http://elements_node_1
      ELEMENTS_WALLET: peerswap
      ELEMENTS_FOLDER: /home/elements/.elements
      ELEMENTS_FOLDER_MAPPED: /home/peerswap/.elements
      # Биткойн RPC
      BITCOIN_HOST: $APP_BITCOIN_NODE_IP
      BITCOIN_PORT: $APP_BITCOIN_RPC_PORT
      BITCOIN_USER: $APP_BITCOIN_RPC_USER
      BITCOIN_PASS: $APP_BITCOIN_RPC_PASS
    volumes:
      - ${APP_DATA_DIR}/data:/home/peerswap/.peerswap
      - ${APP_LIGHTNING_NODE_DATA_DIR}:/home/peerswap/.lnd:ro
      - ${ELEMENTS_DATA_DIR}:/home/peerswap/.elements:ro
      - /etc/localtime:/etc/localtime:ro
