Open thephilluk opened 11 months ago
Hi every one, i am trying to follow https://github.com/saleor/saleor-platform for development purpose but when try to access my saleor dashboard it gives me error as under:- Failed to load resource: net::ERR_CONNECTION_REFUSED localhost:8000/graphql/:1 please guide me how to setup .env exactly as i have configured my public-ip:8000 in .yml file but while accessing it points to localhost:8000. Here is my yml file attached for better understanding. Due to unsuccessfull attempts i have duplicated env variables for every container/ service. thanks for your cooperation
version: "3.4"
services: api: image: ghcr.io/saleor/saleor:unstable-main #ghcr.io/saleor/saleor:3.17 ports:
saleor-redis:/data
worker: image: ghcr.io/saleor/saleor:3.17 command: celery -A saleor --app=saleor.celeryconf:app worker --loglevel=info -B restart: unless-stopped networks:
saleor-media:/app/media
jaeger: image: jaegertracing/all-in-one ports:
saleor-backend-tier
mailpit: image: axllent/mailpit ports:
volumes: saleor-db: driver: local saleor-redis:
driver: local
saleor-media:
networks: saleor-backend-tier: driver: bridge
I had this same issue and had to run this command to update the API_URL after bringing everything up with docker compose up
:
docker exec -it -e API_URL=http://public-ip:8000/graphql/ <dashboard container ID> /docker-entrypoint.d/50-replace-api-url.sh
I got this from the saleor-dashboard docker docs. ~It would be really nice if you could just override this as an environment variable at runtime but it appears impossible for now, at least from what I tried.~
Edit: setting the API_URL
in the environment for the dashboard container does appear to work after all, not sure what I was seeing before. You can verify this by checking the logs after bringing everything up:
$ docker compose logs | grep API_URL
magnolia-dashboard-1 | Setting API_URL to: http://magnolia-api.home.arpa/graphql/
Thank you so much for your solution. i have successfully configured my env variable through same command but my static content is set to localhost:8000 for dashboard product images and images are unable to load but when i manually replace my localhost with public ip of cloud instance it works perfectly fine. Now i want to set docker exec -it -e STATIC_URL=http://public ip :8000/ please share a command for it if you experience it as well. Once again thank you for cooperation.
You can also set your API_URL
value in your docker-compose.yml
as follow:
dashboard:
image: ghcr.io/saleor/saleor-dashboard:latest
ports:
- 9000:80
restart: unless-stopped
environment:
- API_URL=<your-IP-here>:8000/graphql/ # <-- replace your-IP-here
important!: Don't forget to allow your IP in api
service in docker-compose.yml
:
api:
image: ghcr.io/saleor/saleor:3.19
...
environment:
...
- ALLOWED_HOSTS=localhost,api,your-IP <-- add your-IP-here
Hi there,
I checked both issues with the same name (#274 & #280) for solutions and tried those, but the issue still persists.
after following the guide for Docker installation here and everything started up without errors.
when trying to log in with my superuser I get the "Login went wrong. Please try again." error message. After checking the Dev Console I can see that the Dashboard is trying to reach the GraphQL instance on my local machine but the Containers run on my local server.
I tried the methods listed in the Issues I mentioned:
API_URL=http://x.x.x.x:8000/graphql/
env variable under services, dashboard, both with Port and without.docker compose down --volumes db
and running the migrations again.unfortunately after that the issue still persists. most recent try after all tried fixes: Imgur Link
Ports 8000 & 9000 are allowed through the Firewall
any help is appreciated and if you need any info
current docker-compose: