服务器环境
Distributor ID: Debian
Description: Debian GNU/Linux 9.11 (stretch)
Release: 9.11
Codename: stretch
安装宝塔(主要是为了懒,设置SSL,反向代理)
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh
搭建docker环境
apt update
apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
apt update
apt-cache policy docker-ce
root@instance-2:~# apt-cache policy docker-ce
docker-ce:
Installed: (none)
Candidate: 5:19.03.4~3-0~debian-stretch
Version table:
5:19.03.4~3-0~debian-stretch 500
500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
apt install docker-ce
systemctl status docker
root@instance-2:~# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-11-12 04:33:13 UTC; 45s ago
Docs: https://docs.docker.com
Main PID: 15632 (dockerd)
CGroup: /system.slice/docker.service
└─15632 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
安装bitwarden_rs
下载最新版
https://github.com/docker/compose/releases
curl -L https://github.com/docker/compose/releases/download/1.25.0-rc4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
配置文件
cd ~ && mkdir bitwarden && cd bitwarden
cat >> config.env <<EOF
SIGNUPS_ALLOWED=true
DOMAIN=https://example.com
DATABASE_URL=/data/bitwarden.db
ROCKET_WORKERS=10
WEB_VAULT_ENABLED=true
EOF
# https://example.com这个改成你自己的域名即可
cat >> docker-compose.yml <<EOF
version: '3'
services:
bitwarden:
image: mprasil/bitwarden:latest
container_name: bitwarden
restart: always
volumes:
- ./data:/data
env_file:
- config.env
ports:
- "6325:80"
EOF
# 6325修改成自己的端口
docker-compose up -d