Running web on other machine than docker container doesn´t work
Hi,
First of all it really looks good !
When running the container on one machine it works perfect, but opening the page on another machine (linux/android) it shows the landing page and when selecting dashboard you get only the topbar where the light behind "Help" stays red flashing.
# Frontend configuration
ORIGIN=http://hostname.domain:3000
NEXT_PUBLIC_LIVE_SOCKET_URL=http://hostname.domain:4000
NEXT_PUBLIC_API_URL=http://hostname.domain:4001
# Backend configuration
LIVE_BACKEND_ADDRESS=0.0.0.0:4000
API_BACKEND_ADDRESS=0.0.0.0:4001
# Logging configuration
RUST_LOG=api=debug,live=debug
RUST_BACKTRACE=1
it still tries to connect on http://localhost:4000/api/sse, here the client gets a ERR_CONNECTION_REFUSED.
Kind regards,
Marc Bertens
@slowlydev I'll be happy to help with this issue. Let me know if you agree.
@slowlydev I'll be happy to help with this issue. Let me know if you agree.
sure, no need to ask for permission😅
but it seams like its the same issue which has been stated here https://github.com/slowlydev/f1-dash/discussions/184
also make sure to pass the env file to docker compose, see DOCKER.md
Hi.
The compose in commit 12b0e81 was perfectly working on remote machines, using variables passed with env-file.
Then, in commit c7523c9 these variables have been replaced with fixed values (e.g localhost), making the compose not working on remote machines.
Seems to be a regression: the env-file is useless with this compose.
Am I missing something?
Hi.
The
composein commit 12b0e81 was perfectly working on remote machines, using variables passed withenv-file.Then, in commit c7523c9 these variables have been replaced with fixed values (e.g localhost), making the compose not working on remote machines.
Seems to be a regression: the
env-fileis useless with this compose.Am I missing something?
@br0tda I think you're right.
@slowlydev Can you revert the relevant change so that my changes from #232 are restored?
Hi @gacanepa and @br0tda
I am aware that some changes were made to the compose.yaml and that now the env file is not used anymore.
Sadly I don't think just reverting the change 1:1 is the solution as the previous compose.yaml caused issues with the API service and its caching. (fs permissions, which makes sense because of the user).
Also I am not 100% sure on what job the f1-dash compose should have. Should it be a tool to aid in development? Help to quickly set up f1-dash on the local machine or a production deployment?
Personally I am not a huge fan of passing --env-file to docker compose every time and that every env var had to be added explicitly and if I have a .env which I use for local dev and I don't pass another env file via --env-file the values from the .env file get used which could cause accidental misconfiguration, so I reverted that approach for now.
Another question I asked myself is that why not just copy the compose.yaml and configure it to your liking? I mean now that there are releases and a proper ci/cd pipeline for the frontend as well that should be no problem.
If it has to be using some sort of env vars which aren't part of the compose.yaml maybe something like this is a solution which would use defaults which could be overwritten via some sort of env file.
services:
live:
image: ghcr.io/slowlydev/f1-dash-live:latest
build:
context: .
target: live
restart: unless-stopped
ports:
- 4000:4000
environment:
- ORIGIN=${ORIGIN:-"http://localhost:3000"}
These are just my thoughts on this compose topic, what do you think? What would be the best long-term solution? How can we make it as easy as possible for non-tech people to start f1-dash if they wish to do so?
And to the original issue, which the latest compose all I had to do to make it work cross device is adjust the ORIGIN and the LIVE_URL.
From localhost to macbook-pro-slowly.local and on the other machine I used that same hostname to access the frontend. So for example http://macbook-pro-slowly.local:3000
Hi @slowlydev
Another question I asked myself is that why not just copy the
compose.yamland configure it to your liking? I mean now that there are releases and a proper ci/cd pipeline for the frontend as well that should be no problem.
Sure, modifying compost is what I did to run v3 with docker on remote host. Having a compose.yaml with variable is just to run the repo vanilla (having env file externally and ignored by git), but I realize that it is not a big problem.
If it has to be using some sort of env vars which aren't part of the
compose.yamlmaybe something like this is a solution which would use defaults which could be overwritten via some sort of env file. ... These are just my thoughts on this compose topic, what do you think? What would be the best long-term solution? How can we make it as easy as possible for non-tech people to start f1-dash if they wish to do so?
I think this could be a good solution. Maybe most people will not run the code on a remote machine, but locally, so they would never run into this case. But with default values and override capabilities we cover almost all deployments.
Hi, I'm experiencing the same problem, I have f1-dash in my machine and I can connect to it through localhost:3000 but when I try to connect from other devices (phone with data, laptop in other network...) it won't work. I've tried to change the port to 80 in case my ISP were randomly blocking 3000, but nothing appears to work.
Yes, I've opened my router ports.
I've also tried http://
This is my compose.yaml file right now:
services:
live:
image: ghcr.io/slowlydev/f1-dash-live:latest
build:
context: .
target: live
restart: unless-stopped
ports:
- 4000:4000
environment:
- ORIGIN=http://localhost:3000
- LIVE_ADDRESS=0.0.0.0:4000
- RUST_LOG=live=debug,client=debug
api:
image: ghcr.io/slowlydev/f1-dash-api:latest
build:
context: .
target: api
restart: unless-stopped
ports:
- 4001:4001
environment:
- ORIGIN=http://localhost:3000
- API_ADDRESS=0.0.0.0:4001
- RUST_LOG=api=debug
frontend:
image: ghcr.io/slowlydev/f1-dash:latest
build:
context: ./dash/
restart: unless-stopped
ports:
- 80:3000
depends_on:
- api
- live
environment:
- NEXT_PUBLIC_LIVE_URL=http://192.168.100.115:4000
- API_URL=http://api:4001
- DISABLE_IFRAME=1
timescaledb:
image: timescale/timescaledb:latest-pg16
ports:
- 5432:5432
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=password
importer:
image: ghcr.io/slowlydev/f1-dash-importer:latest
build:
context: .
target: importer
environment:
- DATABASE_URL=postgres://postgres:password@timescaledb:5432/postgres
analytics:
image: ghcr.io/slowlydev/f1-dash-analytics:latest
build:
context: .
target: analytics
environment:
- ORIGIN=http://localhost:3000
- ANALYTICS_ADDRESS=0.0.0.0:4002
- RUST_LOG=analytics=debug