frappe_docker icon indicating copy to clipboard operation
frappe_docker copied to clipboard

unable to access http://development.localhost:8000 in dev development

Open sourabhmandal opened this issue 1 year ago • 2 comments

Description of the issue

Trying to access http://development.localhost:8000 from browser loads infinitely when running dev-container

Context information (for bug reports)

I followed the steps mentioned in Development container. However after running the bench start command I am not able to access the website in host machine. However if I do a curl http://development.localhost:8000 inside container itself I am getting a response with HTML page.

PS: I am using MacOS as host machine

Steps to reproduce the issue

  1. Take a macOS laptop
  2. cp -R devcontainer-example .devcontainer
  3. cp -R development/vscode-example development/.vscode
  4. open .devcontainer/docker-compose.yml and comment out MariaDB and its volume and uncomment PostgresDB and its volume
  5. Run dev container in VS code with appropriate extensions as mentioned
  6. Inside container run bench init --skip-redis-config-generation frappe-bench && cd frappe-bench
  7. setup host
bench set-config -g db_host mariadb
bench set-config -g redis_cache redis://redis-cache:6379
bench set-config -g redis_queue redis://redis-queue:6379
bench set-config -g redis_socketio redis://redis-queue:6379
  1. Create new site bench new-site --db-type postgres --db-host postgresql development.localhost
  2. set root password
bench config set-common-config -c root_login postgres
bench config set-common-config -c root_password '"123"'
  1. set dev mode in site
bench --site development.localhost set-config developer_mode 1
bench --site development.localhost clear-cache
  1. bench start
  2. go to http://development.localhost:8000 in host machine

Observed result

  • No HTTP call is received from HOST machine by the app inside docker container.

Expected result

  • http://development.localhost:8000 serving frappe login page

sourabhmandal avatar Sep 16 '24 06:09 sourabhmandal

Thanks for providing such good information. Based on the fact that you are able to request at least some html within the container - I'd expect the problem to be docker or system based. You should at least get a 500 http response if the container is accessible from outside.

Can you check the exposed ports, matching ip address (is development.localhost even mapped to this container?)?

Please be aware, I'm using docker for windows, but there shouldn't be any big differences.

maheini avatar Oct 06 '24 01:10 maheini

I'll not be able to help anyone using Mac or windows.

revant avatar Oct 06 '24 08:10 revant

This issue has been automatically marked as stale. You have a week to explain why you believe this is an error.

github-actions[bot] avatar Dec 06 '24 00:12 github-actions[bot]