README: add the simple docker compose set up

add the yaml block with the simple docker compose set up with the pinned docker image.
add the link to the wiki page "Using Docker Compose".
This commit is contained in:
lumpsoid 2024-01-14 15:31:12 +01:00
parent 890e668071
commit 854a25cdc7
1 changed files with 28 additions and 0 deletions

View File

@ -35,6 +35,7 @@ Basically full implementation of Bitwarden API is provided including:
## Installation
Pull the docker image and mount a volume from the host for persistent storage:
### Using docker run
```sh
docker pull vaultwarden/server:latest
@ -42,6 +43,33 @@ docker run -d --name vaultwarden -v /vw-data/:/data/ --restart unless-stopped -p
```
This will preserve any persistent data under /vw-data/, you can adapt the path to whatever suits you.
### Using docker compose
```yaml
services:
vaultwarden:
container_name: vaultwarden
image: vaultwarden/server:1.30.0
volumes:
- ./vw-data/:/data/
ports:
- 80:80
restart: unless-stopped
```
and `docker compose up` or `docker compose up -d` to pull and run conteiner.
the left side of `volumes:` is where you can find vaultwarden data on your PC/server relative to the folder where you store the docker-compose.yml file
example:
```yaml
vaultwarden-dir/
docker-compose.yml
vw-data/
<vaultwarden data from the /data folder inside the container>
```
the left side of `ports:` is the port your instance will run on (example: `http://127.0.0.1:80`)
For other examples of using docker compose, see wiki page [Using Docker Compose](https://github.com/dani-garcia/vaultwarden/wiki/Using-Docker-Compose).
**IMPORTANT**: Most modern web browsers disallow the use of Web Crypto APIs in insecure contexts. In this case, you might get an error like `Cannot read property 'importKey'`. To solve this problem, you need to access the web vault via HTTPS or localhost.
This can be configured in [vaultwarden directly](https://github.com/dani-garcia/vaultwarden/wiki/Enabling-HTTPS) or using a third-party reverse proxy ([some examples](https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples)).