Community Forum

Ask questions, share your knowledge, and get answered by other devs 😎.

Docker Containers are not able to communicate

**I went into frontend and curl to backend and its works but from the browser its not working** here is my docker-compose file : ```yml version: '1' services: frontend: image: 'ccm-frontend' build: context: ./client dockerfile: Dockerfile.Dev ports: - 3000:3000 networks: - codecommunitymusic-network environment: NODE_OPTIONS: --max-old-space-size=4096 NEXTAUTH_URL: http://frontend:3000 __NEXT_PRIVATE_PREBUNDLED_REACT : next APP_URL: http://frontend:3000 NEXT_PUBLIC_BACKEND_URL: http://backend:8000 BACKEND_URL: http://backend:8000 depends_on: - backend backend: image: 'ccm-backend' build: context: ./server dockerfile: Dockerfile.dev ports: - 8000:8000 networks: - codecommunitymusic-network depends_on: - database environment: - DJANGO_SUPERUSER_USERNAME=admin - DJANGO_SUPERUSER_EMAIL=admin@example.com - DJANGO_SUPERUSER_PASSWORD=password - SECRET_KEY= - DATABASE_NAME=postgres - DATABASE_USER=postgres - DATABASE_PASS=password - DATABASE_HOST=database - EMAIL_HOST_USER=hello@gmail.com - EMAIL_HOST_PASSWORD=demo_password volumes: - ./server:/app command: > sh -c " python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000" database: image: postgres:16-alpine environment: POSTGRES_DB: postgres POSTGRES_USER: postgres POSTGRES_PASSWORD: password networks: - codecommunitymusic-network ports: - 5432:5432 networks: codecommunitymusic-network: driver: bridge ``` Frontend is unable to make api calls to backend I tried localhost and also tried service name but requests are getting failed Error its gives me : xhr.js:251 GET http://backend:8000/users/abhishek net::ERR_NAME_NOT_RESOLVED I tried including them in same network also restarted the instance. I went into frontend and curl to backend and its works but from the browser its not working.

Docker

How to Contribute to Code community Music ?

As a newcomer to the world of open source, I am eager to learn and collaborate with the community, and your project has caught my attention due to its impressive goals and impact. I have a genuine passion for software development, UI/UX desig, and I believe that contributing to this project would be a fantastic opportunity for me to gain hands-on experience, learn from experienced developers, and give back to the open-source community.

Problem Solving
UI/UX Design