-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
35 lines (27 loc) · 1.29 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM vaultwarden/server:latest
# RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get clean && \
apt-get update -y && \
apt-get upgrade -y
# 安装基础软件
RUN apt-get install -y curl wget vim zip unzip \
procps iputils-ping telnet net-tools netcat-traditional \
nginx fail2ban
RUN apt-get install -y python3 python3-pip
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN python -m pip install --upgrade pip --force --no-deps --no-cache-dir --disable-pip-version-check --break-system-packages
# 配置 nginx (反向代理)
ADD ./nginx/etc/bitwarden_http.conf /etc/nginx/sites-available/bitwarden_http.conf
ADD ./nginx/etc/bitwarden_https.conf /etc/nginx/sites-available/bitwarden_https.conf
ADD ./nginx/etc/shared /etc/nginx/shared
RUN mkdir -p /etc/nginx/cert/
# 配置 fail2ban (防爆破)
RUN apt-get install -y fail2ban
RUN rm -f /etc/fail2ban/jail.d/defaults-debian.conf
ADD ./fail2ban/jail.d/bitwarden.local /etc/fail2ban/jail.d/bitwarden.local
ADD ./fail2ban/filter.d/bitwarden.local /etc/fail2ban/filter.d/bitwarden.local
WORKDIR /
RUN echo "alias ll='ls -alF'" >> /root/.bashrc
ADD ./docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod a+x /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]