Skip to content
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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

dockerfile server #111

wants to merge 2 commits into from

Conversation

modship
Copy link
Member

@modship modship commented Sep 11, 2024

No description provided.

WORKDIR /app

# Copy the local binary into the container
COPY ./deweb-server_linux_amd64 /app/deweb-server_linux_amd64
Copy link
Member

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

Copy link
Member Author

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

Comment on lines +16 to +17
# Expose the port on which the server listens (optional, if needed)
EXPOSE 8080
Copy link
Member

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 ?

Copy link
Member Author

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

@modship modship marked this pull request as draft October 3, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants