mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Dockerfile improvements #31
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dustyrip on GitHub (Jul 11, 2018).
Hello, first of all thanks you @dani-garcia and @mprasil for this this project.
Is there a reason for exposing port 80 by default from Dockerfile? I think this should by up to user to decide with
docker run.Also can we get
ROCKET_ENVset toprodor make it user-customizable withdocker run ... -e ROCKET_ENV=prod...it should give us better performance so its worth to try.EDIT: I have created PR.
@mprasil commented on GitHub (Jul 11, 2018):
Hi, it looks like your problem with
EXPOSEcomes from misunderstanding the EXPOSE directive. This just defines the port, that will be exposed when you run container with the-Poption. It does not prevent you in any way to specify your own desired port mapping. So it's merely a default and that default is set based on the fact that server indeed starts on port 80 if you don't specify otherwise viaROCKET_PORT@dustyrip commented on GitHub (Jul 11, 2018):
Yes, but I still think EXPOSE should not be used in Dockerfiles.
docker container lsshows these ports even if not mapped into host so its confusing.@mprasil commented on GitHub (Jul 11, 2018):
Ah I see what you mean there. Unfortunately AFAIK there's no way to tell docker daemon during startup on which port is the application running internally. I'd still leave it in as it is the correct port as long as you don't deliberately change it in which case you're aware that it's different.
Having the
EXPOSEthere makes it a bit easier to use with some systems that can use the port automatically, so it is useful in some cases. Also for example this is handy when running the container with rkt when you try to expose the port.@dani-garcia commented on GitHub (Jul 11, 2018):
I've merged the PR with the ENV changes.
About the
EXPOSEinstruction, I only have some basic knowledge about Docker, so you guys probably have a better idea about what's the most appropiate option. I'll leave that up to you!@mprasil commented on GitHub (Jul 11, 2018):
I'm for leaving it in if you don't mind @dustyrip. The
EXPOSEdirective is definitely useful in it's default configuration. Systems like Nomad, Traefik or Kubernetes can route to the proper container port based on that information without specifying any port mapping.