Deploying bitwarded using docker compose is nice, but limiting. It would be useful to have alongside the ability to deploy to a single docker node to deploy to a docker swarm. I have deployed bitwarden to a swarm to ensure this is in fact a viable approach.
I believe the following changes will be required:
Env files also need to understand the swarm dns addressing. http://identity becomes http://identity.bitwarden for example.
In bitwarden.conf for nginx, locations need to be modified to look like:
location /identity/ {
resolver 127.0.0.11;
set $target http://identity.bitwarden;
rewrite ^/identity/(.*) /$1 break;
proxy_pass $target;
}
This prevents nginx from failing to start properly if bitwarden isn't running. Further the proxy.conf section needs to be brought into the bitwarden.conf file, as well as the map for fido_content_type.
Updating the database is as simple as:
docker service create --restart-condition=none --name setup --network bitwarden --mount type=bind,source=/path/to/bitwarden,destination=/bitwarden bitwarden/setup:latest dotnet Setup.dll -update 1 -db 1
Lastly I found ssl_session_tickets off; to be breaking on the lastest version of nginx for some reason. I didn't really debug that.
Thanks @jassmith . I am not yet very familiar with swarm so I will need to do some research before adding support.
I could probably put together a basic PR if that would be helpful.
I just started looking into this myself - building a docker stack yaml for the services, including any intermediate service containers for setup, and storing config and secrets inside swarm configs and secrets rather than bind mounts, and ensuring networking and volumes are swarm scoped where necessary rather than host scoped.
We are moving away from tracking Bitwarden feature requests like this one as GitHub issues. We have created a Bitwarden Community Forum which has a section for submitting, voting for, and discussing product feature requests.
Please sign up on our forums, search to see if this request already exists. If so, you can vote for it and contribute to any discussions about it. If not, you can re-create the request there so that it can be properly tracked.
This issue will now be closed. Thanks!
@jassmith would you be able to share the dockerfiles and environment variables you used to deploy Bitwarden in a docker swarm?
Is there any progress or update on this issue?
@jassmith Care to share any of your customizations in your PR?
Most helpful comment
I could probably put together a basic PR if that would be helpful.