New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't connect to server after using docker run
#3165
Comments
What is the expected behavior? |
I haven't checked today, but my scheduled job successfully built the image and then ran it on Friday March 1st. That was with commit 56e71d7 |
@paulmelnikow the expected behavior is that http://localhost:8080 will be exposing port :80 of the container and having shields running. However I get connection refused as the container starts but the application startup never finishes - I even have to manually kill the container I have no issues with running any other containers (docker engine 18.0.9.2, Mac). When running the
In container I'm stuck on the line |
I've tried also 56e71d7 with the same result. Maybe the problem is the |
I think the process inside the container needs to bind to all interfaces instead It would be helpful to document all this in self-hosting.md – would definitely welcome contributions there! |
docker run
1. Set NODE_ENV=production in Docker. 2. When NODE_ENV is production, bind to all interfaces. This seems like a sensible default. 3. Exclude Dockerfile from container to improve layer cacheability when modifying the dockerfile. Ref #3165
I'm guessing the only way the Dockerfile works today is by to pass an alternative command to run, like The reason the process isn't receiving a signal is that you need It would be great to document which CLI arguments are commended. I'm not sure what |
I'm personally running a |
Ah, right, I forgot you could set the bind through the env. Seems good to have it an entrypoint that works by default!
Sounds worth including then. 👍 |
* Tweak Docker initialization 1. Set NODE_ENV=production in Docker. 2. When NODE_ENV is production, bind to all interfaces. This seems like a sensible default. 3. Exclude Dockerfile from container to improve layer cacheability when modifying the dockerfile. Ref #3165 * Rm obsolete comment
using the latest Dockerfile from master, I'm able to build the image, and run the container (on Ubuntu 18.04) successfully (the only environment variables I'm passing to the container are tokens/credentials for various badge services) |
Would welcome a PR for the docs! Let's leave this open until that's taken care of. |
I can confirm, it's working now. Great work and thanks! |
@paulmelnikow - what's in scope for the doc updates? The self-hosting doc section for docker currently shows: $ docker run --rm -p 8080:80 --name shields shields
# or if you have shields.env file, run the following instead
$ docker run --rm -p 8080:80 --env-file shields.env --name shields shields So are you thinking the doc should include details/descriptions about the args shown (port mapping, clean up, etc.) and/or why the guide suggests those? |
🪲 Description
I'm following the instructions in
doc/self-hosting.md
to first build the Docker image (which works fine) and then run the container usingdocker run --rm -p 8080:80 --name shields shields
.It looks like the container hangs forever:
I think it expects a response from Gatsby or something (I'm not a Node expert).
If I run the app manually using
npm start
it works, but I'd like to containerize it.The text was updated successfully, but these errors were encountered: