From c5c5afa933d6f4db29f28360c9fcf3a78daa1341 Mon Sep 17 00:00:00 2001 From: koalasat Date: Fri, 11 Apr 2025 16:29:36 +0200 Subject: [PATCH] Add docker frontend --- .gitignore | 1 + frontend/docker-compose.yml | 22 ++++++++++++++++++++++ frontend/src/contexts/AppContext.tsx | 8 ++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 frontend/docker-compose.yml diff --git a/.gitignore b/.gitignore index 90c01937..01e3d2d3 100755 --- a/.gitignore +++ b/.gitignore @@ -651,6 +651,7 @@ desktopApp/release-builds # frontend statics frontend/templates/frontend/*.html mobile/html/Web.bundle +frontend/*.html desktopApp/static desktopApp/*.html web/static diff --git a/frontend/docker-compose.yml b/frontend/docker-compose.yml new file mode 100644 index 00000000..3172a32c --- /dev/null +++ b/frontend/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.9' +# Frontend and node client development orchestration +name: robosats-frontend +services: + frontend: + build: ./ + container_name: dev-frontend + volumes: + - ./:/usr/src/frontend + - ../web:/usr/src/web + + nginx: + build: ../web + container_name: dev-nginx + restart: always + volumes: + - ./:/usr/src/frontend + - ../web:/usr/src/web + - ../web/nginx.conf:/etc/nginx/nginx.conf + - ../web/coordinators/:/etc/nginx/conf.d/ + ports: + - 8888:80 diff --git a/frontend/src/contexts/AppContext.tsx b/frontend/src/contexts/AppContext.tsx index 8c2de7ae..e74f3b38 100644 --- a/frontend/src/contexts/AppContext.tsx +++ b/frontend/src/contexts/AppContext.tsx @@ -95,8 +95,12 @@ const getOrigin = (network = 'mainnet'): Origin => { const host = getHostUrl(network); let origin: Origin = 'onion'; const [client] = window.RobosatsSettings.split('-'); - - if (client === 'mobile' || client === 'desktop' || host.includes('.onion')) { + if ( + client === 'mobile' || + client === 'desktop' || + host.includes('.onion') || + host.includes(':8888') + ) { origin = 'onion'; } else if (host.includes('i2p')) { origin = 'i2p';