Closed Bahatte closed 11 months ago
Please try the following compose file:
version: "3.8"
services:
backend:
build: ./backend
container_name: backend
ports:
- "8000:8000"
frontend:
build:
context: ./frontend
args:
- BACKEND_URL=http://10.99.199.12:8000 # Backend URL without trailing slash
container_name: frontend
ports:
- "3000:3000"
stdin_open: true
tty: true
nope still the same error?
Please clone the repository again. There was an error when passing the backend URL to the container. It should work now.
Hello again. The problem is still the same with a new cloned repository.
Same errors here :(
Please try docker compose up --buil
to rebuild the images and test again.
I just rebuild the images and started the containers but still having the same error.
Please have a look into your browser console to see where the frontend is trying to connect to.
xhr.js:220
GET http://localhost:3000/api/apikeys/is_active net::ERR_CONNECTION_REFUSED
xhr.js:220
GET http://localhost:3000/api/settings/modules/ net::ERR_CONNECTION_REFUSED
172.20.0.70/:1 Uncaught (in promise)
AxiosError {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …}
xhr.js:220
GET http://localhost:3000/api/settings/general/ net::ERR_CONNECTION_REFUSED
xhr.js:220
GET http://localhost:3000/api/settings/modules/newsfeed/ net::ERR_CONNECTION_REFUSED
172.20.0.70/:1 Uncaught (in promise)
AxiosError {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …}
code
:
"ERR_NETWORK"
config
:
{transitional: {…}, transformRequest: Array(1), transformResponse: Array(1), timeout: 0, adapter: ƒ, …}
message
:
"Network Error"
name
:
"AxiosError"
request
:
XMLHttpRequest {data: undefined, onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: false, …}
response
:
XMLHttpRequest {data: undefined, onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: false, …}
[[Prototype]]
:
Error
172.20.0.70 is docker host ip
Did you uncomment the argument section for the backend URL in your Docker Compose file? It should look like this for you:
version: "3.8"
services:
backend:
build: ./backend
container_name: backend
ports:
- "8000:8000"
frontend:
build:
context: ./frontend
args:
- BACKEND_URL=http://172.20.0.70 # Backend URL without trailing slash
container_name: frontend
ports:
- "3000:3000"
stdin_open: true
tty: true
Still not working. Same error but with 172.20.0.70 ip
Thanks a lot it works for me... ill close the issue. Thanks a lot for quick help!
Hello... i have a problem and dont know how to solve it... i tried to change docker-compose.yml but it does not work:
version: "3.8" services: backend: build: ./backend container_name: backend ports: