-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy with Redis on another server #360
Comments
Hi @Erislandys , I don't think it is related to Redis actually. This error is due to the front-end trying to connect to the backend. By default, front-end will try to connect to the backend on "localhost:3030". This can be changed by setting two environment variables:
For example, Could you tell more about how exactly do you launch backend and frontend? I'll be able to give a more precise advise depending on that. |
Thanks @valcker Compose: services: networks: |
Hi @valcker, I' m trying to deploy locally using docker image, and frontend is making a request to http://localhost:3030/graphql and of course fail, 'cause this react app run in browser and the backend app is not running in the host machine, even when I passing the two two environment variables (REACT_APP_DASHBOARD_URL, REACT_APP_DASHBOARD_WS_URL). |
Hey @Erislandys. That's the issue with this version of the Docker Compose. We are serving the front-end via our backend. It works locally for testing purposes, but we normally deploy the frontend separately when deploying to the cloud. I will create another Docker Compose file that will serve the frontend via Nginx. How urgent is that for you? |
Hi @rmolinet. Are you trying to deploy using the Dockerfile shipped with the dashboard, or you are trying to launch a docker compose file? |
@rmolinet in case if you are using a Dockerfile and not docker compose, there is an issue with it and I just pushed a fix here #373 . Once merged, it will build and upload the latest docker image to docker hub. We are behind the schedule with documentation, so I'll just write the launch instructions here (and I hope I'll be able to update the docs this week!).
NODE_ENV=production
DASHBOARD_SECRET=
HOST=localhost
PUBLIC_HOST=https://localhost:3030
DASHBOARD_PORT=3030
GRAPHQL_PLAYGROUND=true
SERVE_STATIC=true
JWT_SECRET=secret
[email protected]
DEFAULT_ADMIN_PASSWORD=Secret123!
REDIS_CONNECTION_STRING=redis://docker-redis:6379
MONGODB_CONNECTION_STRING=mongodb://docker-mongo:27017/graphql-portal-dashboard You'll have to modify REDIS_CONNECTION_STRING and MONGODB_CONNECTION_STRING depending on your local conditions.
docker run --name graphql-dashboard --env-file={path to env file} --link docker-redis:redis --link docker-mongo:mongo -p 3030:3030 gqlportal/dashboard:latest Don't forget to replace And ping me here if you'll still have any issues! |
@valcker thank you very much for your response, I'll be attentive to your response with docker-compose. I'm very interested in running this gateway |
Hi there @valcker thanks for responding, maybe I was not more explicit, I'm trying to deploy the dashboard using the latest docker image in docker hub, for this I'm using compose, but everythings seems work fine except when I try to login the react frontend app do not make the request to the right location of nestjs backend application, running both in the container, here is my environment config in compose file: |
Hi @rmolinet . I recently updated the Dockerfile of a Dashboard, it should become easier to launch it now. It now exposes port 3030 for backend and port 8080 for front-end, which run separately. Your launch configuration should be the following: REDIS_CONNECTION_STRING=redis://external-redis-host:6379
MONGODB_CONNECTION_STRING=mongodb://mongoadmin:[email protected]:27017/gateway_dashboard?authSource=admin
PUBLIC_HOST=http://webserver.gateway.com:8080
HOST=webserver.gateway.com
DASHBOARD_PORT=3030
SERVE_STATIC=false
NODE_ENV=production
[email protected]
DEFAULT_ADMIN_PASSWORD=AdminPassword
REACT_APP_DASHBOARD_URL=http://webserver.gateway.com:3030 Few changes:
You should also set It should do the job. P.S: By writing this I understand that we need to simplify the launch process :) Any advice on this are welcome. |
Hi @Erislandys . Please try to update your docker compose file by adding the following variables:
Dockerfile now exposes two ports: 3030 for backend and 8080 for frontend. You need to tell REACT app how to find our backend by setting REACT_APP_DASHBOARD_URL to the public URL of the backend. Don't hesitate to ping me if you need more info, we can organize a chat if needed. |
@valcker Thank you very much, I do the tests and comment |
Hi @valcker, sorry for the inconvenience, but I still have the same issue, probably due to ignorance, here is my last environment configuration in compose, I download the latest dashboard docker image, and still the front make the login request to localhost:3030, if you prefer I can upload an screenshot. |
@rmolinet please don't be sorry, we are here to help! Would you be able to join me in slack, or discord, or telegram (or any other messenger for that matter) so that we could debug it quickly together? Which chat do you prefer more? |
Hi @valcker I prefer Discord, rrmolinet#7486 is my username. Regards |
Perfect. Sent you a request there. My username is valcker#4507 |
@valcker I'm having a similar issue, Dashboard is using localhost even passing I think 🤔 dockerfile is overriding the ENV But I get the right env when I do echo so that's not the case. Not sure 🤷🏻♂️ |
Hey @dipakparmar , Sorry for the long response on my side, was off last week. Can you help me reproduce it on my side? Could you list the steps to get the same problem? Thanks, |
When I deploy the dashboard passing in an environment variable the remote address of Redis, it lifts the authentication, but then it continues making calls to a local Redis
graphportal-dasboard-dev.azurewebsites.net-1615668376001.log
The text was updated successfully, but these errors were encountered: