Closed The-Inamati closed 4 years ago
Sounds like a docker issue to me, I've never encountered containers restarting like you describe - if something in the container doesn't work (e.g. the api doesn't start correctly) then the container will keep running but the api won't be accessible.
When what's supposed to run in the container fails the container stops. But if you have restart always like I do it will keep stopping and starting ad eternum.
Try running the containers individually using docker
(not docker-compose
). Start with mongodb, then api. Keep things simple and see what breaks. It sounds to me like this is a general docker issue though, not an xbrowsersync issue. You should be able to take the vanilla api docker compose yml and run it like everyone else.
OK. So I reviewed everything and the container is now running. However it's behind traefik v2 and the webpage appears without formatting. Any ideas?
Neverming. Got it. Thanks.
Glad to hear you got it sorted @The-Inamati!
@The-Inamati and what was the solution to this problem?
Hi, I desperately need your help. I have tried to deploy xbrowsersync with docker compose for several times now and the api container keeps restarting.
I tried with image versions 1.10,1.11 and 1.12.
My docker-compose file is
I also have tried with the default compose file in github just changing the network and it still restarts. All the variables are in the env file. I have over 40 containers and this is the only one with this behavior.
I also provided the settings.json and mongoconfig.js as needed.
I tried running the container with
docker run --name xbs-api -p 8180:8080 -e XBROWSERSYNC_DB_USER -e XBROWSERSYNC_DB_PWD -v $USERDIR/xbrowser/settings.json:/usr/src/api/config/settings.json -d xbrowsersync/api
providing the variables and still restarts.Bind mounts have 777 permissions just in case and nothing.
the mongoconfig.js file only has what's on github and the settings.json has
The container restarts too fast to access and doesn't log anything. I tried bind mounting the log directory but nothing is written. I also ran the container with entrypoint /bin/ash to keep it from restarting and doesn't work and nothing gets logged.
What am I missing?