-
Notifications
You must be signed in to change notification settings - Fork 1
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
dockerfile server #111
base: main
Are you sure you want to change the base?
dockerfile server #111
Conversation
WORKDIR /app | ||
|
||
# Copy the local binary into the container | ||
COPY ./deweb-server_linux_amd64 /app/deweb-server_linux_amd64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure we should do that
IMO, we should divide this dockerfile into 2 stages, one to build and the other to run the image, so we don't require the host computer to have already built the binary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good solution; it's called a multi-stage build, which we discussed last week.
Another option is to place the binary directly into the image (as done here) and tag the image based on the binary (built by a CI or a third party).
Ex : deweb_server:1.0.0 contains the version 1.0.0 of deweb ... and user choose different version of the docker image based on the deweb server. (And pass a config file if needed).
But yeah let me work on multi stage build if u want
# Expose the port on which the server listens (optional, if needed) | ||
EXPOSE 8080 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users might want to use a specific DeWeb server configuration and so, use a different port, is that something that can be handled ? Or should users using docker change the exposed port another way than the DeWeb server config file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's why docker is so cool.
EXPOSE here say, IN the docker container we want to expose the port 8080 (because i know my software use this port), OTHER ports can't be acceded.
user can choose to use any port on their host machine ( ex with -p option)
ex user want to run deweb_server on port 5000 :
docker run -p 5000:8080 deweb_server
No description provided.