mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
goso all the things
This commit is contained in:
parent
005f1e59a0
commit
a205f40613
@ -51,8 +51,14 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
docker pull bitwarden/setup:$COREVERSION
|
docker pull bitwarden/setup:$COREVERSION
|
||||||
docker run -it --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION \
|
if [ $OS == "lin" ]
|
||||||
dotnet Setup.dll -install 1 -domain $DOMAIN -letsencrypt $LETS_ENCRYPT -os $OS -corev $COREVERSION -webv $WEBVERSION
|
then
|
||||||
|
docker run -it --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION -e LOCAL_UID=`id -u $USER` \
|
||||||
|
dotnet Setup.dll -install 1 -domain $DOMAIN -letsencrypt $LETS_ENCRYPT -os $OS -corev $COREVERSION -webv $WEBVERSION
|
||||||
|
else
|
||||||
|
docker run -it --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION \
|
||||||
|
dotnet Setup.dll -install 1 -domain $DOMAIN -letsencrypt $LETS_ENCRYPT -os $OS -corev $COREVERSION -webv $WEBVERSION
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Setup complete"
|
echo "Setup complete"
|
||||||
|
@ -68,28 +68,49 @@ function updateLetsEncrypt() {
|
|||||||
if [ -d "${OUTPUT_DIR}/letsencrypt/live" ]
|
if [ -d "${OUTPUT_DIR}/letsencrypt/live" ]
|
||||||
then
|
then
|
||||||
docker pull certbot/certbot
|
docker pull certbot/certbot
|
||||||
docker run -i --rm --name certbot -p 443:443 -p 80:80 -v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \
|
docker run -i --rm --name certbot -p 443:443 -p 80:80 \
|
||||||
|
-v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \
|
||||||
renew --logs-dir /etc/letsencrypt/logs
|
renew --logs-dir /etc/letsencrypt/logs
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDatabase() {
|
function updateDatabase() {
|
||||||
pullSetup
|
pullSetup
|
||||||
docker run -i --rm --name setup --network container:bitwarden-mssql -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION \
|
if [ $OS == "lin" ]
|
||||||
dotnet Setup.dll -update 1 -db 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
then
|
||||||
|
docker run -i --rm --name setup --network container:bitwarden-mssql \
|
||||||
|
-v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION -e LOCAL_UID=`id -u $USER` \
|
||||||
|
dotnet Setup.dll -update 1 -db 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
||||||
|
else
|
||||||
|
docker run -i --rm --name setup --network container:bitwarden-mssql \
|
||||||
|
-v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION \
|
||||||
|
dotnet Setup.dll -update 1 -db 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
||||||
|
fi
|
||||||
echo "Database update complete"
|
echo "Database update complete"
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
pullSetup
|
pullSetup
|
||||||
docker run -i --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION \
|
if [ $OS == "lin" ]
|
||||||
dotnet Setup.dll -update 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
then
|
||||||
|
docker run -i --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION -e LOCAL_UID=`id -u $USER` \
|
||||||
|
dotnet Setup.dll -update 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
||||||
|
else
|
||||||
|
docker run -i --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION \
|
||||||
|
dotnet Setup.dll -update 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function printEnvironment() {
|
function printEnvironment() {
|
||||||
pullSetup
|
pullSetup
|
||||||
docker run -i --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION \
|
if [ $OS == "lin" ]
|
||||||
dotnet Setup.dll -printenv 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
then
|
||||||
|
docker run -i --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION -e LOCAL_UID=`id -u $USER` \
|
||||||
|
dotnet Setup.dll -printenv 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
||||||
|
else
|
||||||
|
docker run -i --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$COREVERSION \
|
||||||
|
dotnet Setup.dll -printenv 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function restart() {
|
function restart() {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
FROM microsoft/aspnetcore:2.0.5
|
FROM microsoft/aspnetcore:2.0.5
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
gosu \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENV ASPNETCORE_URLS http://+:5000
|
ENV ASPNETCORE_URLS http://+:5000
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
@ -7,12 +12,6 @@ COPY obj/Docker/publish .
|
|||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN groupadd -g 999 bitwarden \
|
RUN groupadd -g 999 bitwarden \
|
||||||
&& useradd -r -u 999 -g bitwarden bitwarden \
|
&& chmod +x /entrypoint.sh
|
||||||
&& chown -R bitwarden:bitwarden /app \
|
|
||||||
&& mkdir -p /etc/bitwarden/core \
|
|
||||||
&& chown -R bitwarden:bitwarden /etc/bitwarden \
|
|
||||||
&& chmod +x /entrypoint.sh \
|
|
||||||
&& chown bitwarden:bitwarden /entrypoint.sh
|
|
||||||
|
|
||||||
USER bitwarden
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
dotnet /app/Admin.dll
|
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden
|
||||||
|
|
||||||
|
chown -R bitwarden:bitwarden /app
|
||||||
|
mkdir -p /etc/bitwarden/core
|
||||||
|
chown -R bitwarden:bitwarden /etc/bitwarden
|
||||||
|
|
||||||
|
gosu bitwarden:bitwarden dotnet /app/Admin.dll
|
||||||
|
@ -14,16 +14,9 @@ COPY obj/Docker/publish/Jobs /jobs
|
|||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN mv /jobs/crontab /etc/cron.d/bitwarden-cron \
|
RUN mv /jobs/crontab /etc/cron.d/bitwarden-cron \
|
||||||
&& chmod 0644 /etc/cron.d/bitwarden-cron \
|
&& chmod 0644 /etc/cron.d/bitwarden-cron
|
||||||
&& touch /var/log/cron.log
|
|
||||||
|
|
||||||
RUN groupadd -g 999 bitwarden \
|
RUN groupadd -g 999 bitwarden \
|
||||||
&& useradd -r -u 999 -g bitwarden bitwarden \
|
&& chmod +x /entrypoint.sh
|
||||||
&& chown -R bitwarden:bitwarden /app \
|
|
||||||
&& chown -R bitwarden:bitwarden /jobs \
|
|
||||||
&& mkdir -p /etc/bitwarden/core \
|
|
||||||
&& chown -R bitwarden:bitwarden /etc/bitwarden \
|
|
||||||
&& chmod +x /entrypoint.sh \
|
|
||||||
&& chown bitwarden:bitwarden /entrypoint.sh
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden
|
||||||
|
|
||||||
|
touch /var/log/cron.log
|
||||||
|
chown bitwarden:bitwarden /var/log/cron.log
|
||||||
|
chown -R bitwarden:bitwarden /app
|
||||||
|
chown -R bitwarden:bitwarden /jobs
|
||||||
|
mkdir -p /etc/bitwarden/core
|
||||||
|
chown -R bitwarden:bitwarden /etc/bitwarden
|
||||||
|
|
||||||
env >> /etc/environment
|
env >> /etc/environment
|
||||||
cron
|
cron
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ FROM microsoft/aspnetcore:2.0.5
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
unzip \
|
unzip \
|
||||||
|
gosu \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
@ -19,11 +20,6 @@ COPY obj/Docker/publish .
|
|||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN groupadd -g 999 bitwarden \
|
RUN groupadd -g 999 bitwarden \
|
||||||
&& useradd -r -u 999 -g bitwarden bitwarden \
|
&& chmod +x /entrypoint.sh
|
||||||
&& chown -R bitwarden:bitwarden /app \
|
|
||||||
&& chown -R bitwarden:bitwarden /etc/iconserver \
|
|
||||||
&& chmod +x /entrypoint.sh \
|
|
||||||
&& chown bitwarden:bitwarden /entrypoint.sh
|
|
||||||
|
|
||||||
USER bitwarden
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
/etc/iconserver/iconserver &
|
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden
|
||||||
dotnet /app/Icons.dll iconsSettings:bestIconBaseUrl=http://localhost:8080
|
|
||||||
|
chown -R bitwarden:bitwarden /app
|
||||||
|
chown -R bitwarden:bitwarden /etc/iconserver
|
||||||
|
|
||||||
|
gosu bitwarden:bitwarden /etc/iconserver/iconserver &
|
||||||
|
gosu bitwarden:bitwarden dotnet /app/Icons.dll iconsSettings:bestIconBaseUrl=http://localhost:8080
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
FROM microsoft/aspnetcore:2.0.5
|
FROM microsoft/aspnetcore:2.0.5
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
gosu \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENV ASPNETCORE_URLS http://+:5000
|
ENV ASPNETCORE_URLS http://+:5000
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
@ -7,13 +12,6 @@ COPY obj/Docker/publish .
|
|||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN groupadd -g 999 bitwarden \
|
RUN groupadd -g 999 bitwarden \
|
||||||
&& useradd -r -u 999 -g bitwarden bitwarden \
|
&& chmod +x /entrypoint.sh
|
||||||
&& chown -R bitwarden:bitwarden /app \
|
|
||||||
&& mkdir -p /etc/bitwarden/identity \
|
|
||||||
&& mkdir -p /etc/bitwarden/core \
|
|
||||||
&& chown -R bitwarden:bitwarden /etc/bitwarden \
|
|
||||||
&& chmod +x /entrypoint.sh \
|
|
||||||
&& chown bitwarden:bitwarden /entrypoint.sh
|
|
||||||
|
|
||||||
USER bitwarden
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden
|
||||||
|
|
||||||
|
mkdir -p /etc/bitwarden/identity
|
||||||
|
mkdir -p /etc/bitwarden/core
|
||||||
|
chown -R bitwarden:bitwarden /etc/bitwarden
|
||||||
|
|
||||||
cp /etc/bitwarden/identity/identity.pfx /app/identity.pfx
|
cp /etc/bitwarden/identity/identity.pfx /app/identity.pfx
|
||||||
dotnet /app/Identity.dll
|
chown -R bitwarden:bitwarden /app
|
||||||
|
|
||||||
|
gosu bitwarden:bitwarden dotnet /app/Identity.dll
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
FROM bitwarden/server
|
FROM bitwarden/server
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
gosu \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENV ASPNETCORE_URLS http://+:5000
|
ENV ASPNETCORE_URLS http://+:5000
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN groupadd -g 999 bitwarden \
|
RUN groupadd -g 999 bitwarden \
|
||||||
&& useradd -r -u 999 -g bitwarden bitwarden \
|
&& chmod +x /entrypoint.sh
|
||||||
&& chown -R bitwarden:bitwarden /bitwarden_server \
|
|
||||||
&& mkdir -p /etc/bitwarden/core/attachments \
|
|
||||||
&& chown -R bitwarden:bitwarden /etc/bitwarden \
|
|
||||||
&& chmod +x /entrypoint.sh \
|
|
||||||
&& chown bitwarden:bitwarden /entrypoint.sh
|
|
||||||
|
|
||||||
USER bitwarden
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
dotnet /bitwarden_server/Server.dll /contentRoot=/etc/bitwarden/core/attachments /webRoot=. /serveUnknown=true
|
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden
|
||||||
|
|
||||||
|
chown -R bitwarden:bitwarden /bitwarden_server
|
||||||
|
mkdir -p /etc/bitwarden/core/attachments
|
||||||
|
chown -R bitwarden:bitwarden /etc/bitwarden
|
||||||
|
|
||||||
|
gosu bitwarden:bitwarden dotnet /bitwarden_server/Server.dll \
|
||||||
|
/contentRoot=/etc/bitwarden/core/attachments /webRoot=. /serveUnknown=true
|
||||||
|
@ -6,26 +6,14 @@ RUN apt-get update \
|
|||||||
gosu \
|
gosu \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN groupadd -g 999 bitwarden \
|
RUN groupadd -g 999 bitwarden
|
||||||
&& useradd -r -u 999 -g bitwarden bitwarden
|
|
||||||
|
|
||||||
COPY crontab /etc/cron.d/bitwarden-cron
|
COPY crontab /etc/cron.d/bitwarden-cron
|
||||||
RUN chmod 0644 /etc/cron.d/bitwarden-cron \
|
RUN chmod 0644 /etc/cron.d/bitwarden-cron
|
||||||
&& touch /var/log/cron.log \
|
|
||||||
&& chown bitwarden:bitwarden /var/log/cron.log
|
|
||||||
|
|
||||||
COPY backup-db.sql /
|
COPY backup-db.sql /
|
||||||
COPY backup-db.sh /
|
COPY backup-db.sh /
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN mkdir -p /etc/bitwarden/mssql/backups \
|
RUN chmod +x /entrypoint.sh \
|
||||||
&& chown -R bitwarden:bitwarden /etc/bitwarden \
|
&& chmod +x /backup-db.sh
|
||||||
&& mkdir -p /var/opt/mssql/data \
|
|
||||||
&& chown -R bitwarden:bitwarden /var/opt/mssql \
|
|
||||||
&& chmod +x /entrypoint.sh \
|
|
||||||
&& chmod +x /backup-db.sh \
|
|
||||||
&& chown bitwarden:bitwarden /entrypoint.sh \
|
|
||||||
&& chown bitwarden:bitwarden /backup-db.sh \
|
|
||||||
&& chown bitwarden:bitwarden /backup-db.sql
|
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -1,7 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden
|
||||||
|
|
||||||
|
touch /var/log/cron.log
|
||||||
|
chown bitwarden:bitwarden /var/log/cron.log
|
||||||
|
mkdir -p /etc/bitwarden/mssql/backups
|
||||||
|
chown -R bitwarden:bitwarden /etc/bitwarden
|
||||||
|
mkdir -p /var/opt/mssql/data
|
||||||
|
chown -R bitwarden:bitwarden /var/opt/mssql
|
||||||
|
chown bitwarden:bitwarden /backup-db.sh
|
||||||
|
chown bitwarden:bitwarden /backup-db.sql
|
||||||
|
|
||||||
env >> /etc/environment
|
env >> /etc/environment
|
||||||
cron
|
cron
|
||||||
|
|
||||||
chown -R bitwarden:bitwarden /var/opt/mssql
|
|
||||||
gosu bitwarden:bitwarden /opt/mssql/bin/sqlservr
|
gosu bitwarden:bitwarden /opt/mssql/bin/sqlservr
|
||||||
|
@ -1,25 +1,16 @@
|
|||||||
FROM nginx:1.12
|
FROM nginx:1.12
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
gosu \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx
|
COPY nginx.conf /etc/nginx
|
||||||
COPY proxy.conf /etc/nginx
|
COPY proxy.conf /etc/nginx
|
||||||
COPY mime.types /etc/nginx
|
COPY mime.types /etc/nginx
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN groupadd -g 999 bitwarden \
|
RUN groupadd -g 999 bitwarden \
|
||||||
&& useradd -r -u 999 -g bitwarden bitwarden \
|
&& chmod +x /entrypoint.sh
|
||||||
&& mkdir -p /etc/bitwarden/nginx \
|
|
||||||
&& chown -R bitwarden:bitwarden /etc/bitwarden \
|
|
||||||
&& mkdir /etc/letsencrypt \
|
|
||||||
&& chown -R bitwarden:bitwarden /etc/letsencrypt \
|
|
||||||
&& mkdir /etc/ssl \
|
|
||||||
&& chown -R bitwarden:bitwarden /etc/ssl \
|
|
||||||
&& chmod +x /entrypoint.sh \
|
|
||||||
&& chown bitwarden:bitwarden /entrypoint.sh \
|
|
||||||
&& touch /var/run/nginx.pid \
|
|
||||||
&& touch /etc/nginx/conf.d/default.conf \
|
|
||||||
&& chown bitwarden:bitwarden /var/run/nginx.pid \
|
|
||||||
&& chown bitwarden:bitwarden /etc/nginx/conf.d/default.conf \
|
|
||||||
&& chown -R bitwarden:bitwarden /var/cache/nginx
|
|
||||||
|
|
||||||
USER bitwarden
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -1,4 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden
|
||||||
|
|
||||||
|
chown -R bitwarden:bitwarden /etc/bitwarden
|
||||||
cp /etc/bitwarden/nginx/default.conf /etc/nginx/conf.d/default.conf
|
cp /etc/bitwarden/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||||
nginx -g 'daemon off;'
|
mkdir -p /etc/letsencrypt
|
||||||
|
chown -R bitwarden:bitwarden /etc/letsencrypt
|
||||||
|
mkdir -p /etc/ssl
|
||||||
|
chown -R bitwarden:bitwarden /etc/ssl
|
||||||
|
touch /var/run/nginx.pid
|
||||||
|
chown bitwarden:bitwarden /var/run/nginx.pid
|
||||||
|
chown -R bitwarden:bitwarden /var/cache/nginx
|
||||||
|
|
||||||
|
gosu bitwarden:bitwarden nginx -g 'daemon off;'
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
*
|
*
|
||||||
!obj/Docker/publish/*
|
!obj/Docker/publish/*
|
||||||
!obj/Docker/empty/
|
!obj/Docker/empty/
|
||||||
|
!entrypoint.sh
|
||||||
|
@ -108,6 +108,7 @@ services:
|
|||||||
- ../mssql/backups:/etc/bitwarden/mssql/backups
|
- ../mssql/backups:/etc/bitwarden/mssql/backups
|
||||||
env_file:
|
env_file:
|
||||||
- mssql.env
|
- mssql.env
|
||||||
|
- ../env/uid.env
|
||||||
- ../env/mssql.override.env
|
- ../env/mssql.override.env
|
||||||
|
|
||||||
web:
|
web:
|
||||||
@ -116,6 +117,8 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ../web:/etc/bitwarden/web
|
- ../web:/etc/bitwarden/web
|
||||||
|
env_file:
|
||||||
|
- ../env/uid.env
|
||||||
|
|
||||||
attachments:
|
attachments:
|
||||||
image: bitwarden/attachments:{CoreVersion}
|
image: bitwarden/attachments:{CoreVersion}
|
||||||
@ -123,6 +126,8 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ../core/attachments:/etc/bitwarden/core/attachments
|
- ../core/attachments:/etc/bitwarden/core/attachments
|
||||||
|
env_file:
|
||||||
|
- ../env/uid.env
|
||||||
|
|
||||||
api:
|
api:
|
||||||
image: bitwarden/api:{CoreVersion}
|
image: bitwarden/api:{CoreVersion}
|
||||||
@ -132,6 +137,7 @@ services:
|
|||||||
- ../core:/etc/bitwarden/core
|
- ../core:/etc/bitwarden/core
|
||||||
env_file:
|
env_file:
|
||||||
- global.env
|
- global.env
|
||||||
|
- ../env/uid.env
|
||||||
- ../env/global.override.env
|
- ../env/global.override.env
|
||||||
|
|
||||||
identity:
|
identity:
|
||||||
@ -143,6 +149,7 @@ services:
|
|||||||
- ../core:/etc/bitwarden/core
|
- ../core:/etc/bitwarden/core
|
||||||
env_file:
|
env_file:
|
||||||
- global.env
|
- global.env
|
||||||
|
- ../env/uid.env
|
||||||
- ../env/global.override.env
|
- ../env/global.override.env
|
||||||
|
|
||||||
admin:
|
admin:
|
||||||
@ -153,12 +160,15 @@ services:
|
|||||||
- ../core:/etc/bitwarden/core
|
- ../core:/etc/bitwarden/core
|
||||||
env_file:
|
env_file:
|
||||||
- global.env
|
- global.env
|
||||||
|
- ../env/uid.env
|
||||||
- ../env/global.override.env
|
- ../env/global.override.env
|
||||||
|
|
||||||
icons:
|
icons:
|
||||||
image: bitwarden/icons:{CoreVersion}
|
image: bitwarden/icons:{CoreVersion}
|
||||||
container_name: bitwarden-icons
|
container_name: bitwarden-icons
|
||||||
restart: always
|
restart: always
|
||||||
|
env_file:
|
||||||
|
- ../env/uid.env
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: bitwarden/nginx:{CoreVersion}
|
image: bitwarden/nginx:{CoreVersion}
|
||||||
@ -170,7 +180,9 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ../nginx:/etc/bitwarden/nginx
|
- ../nginx:/etc/bitwarden/nginx
|
||||||
- ../letsencrypt:/etc/letsencrypt
|
- ../letsencrypt:/etc/letsencrypt
|
||||||
- ../ssl:/etc/ssl");
|
- ../ssl:/etc/ssl
|
||||||
|
env_file:
|
||||||
|
- ../env/uid.env");
|
||||||
|
|
||||||
if(MssqlDataDockerVolume)
|
if(MssqlDataDockerVolume)
|
||||||
{
|
{
|
||||||
|
@ -3,15 +3,14 @@ FROM microsoft/dotnet:2.0.5-runtime
|
|||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
openssl \
|
openssl \
|
||||||
|
gosu \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY obj/Docker/publish .
|
COPY obj/Docker/publish .
|
||||||
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
RUN groupadd -g 999 bitwarden \
|
RUN groupadd -g 999 bitwarden \
|
||||||
&& useradd -r -u 999 -g bitwarden bitwarden \
|
&& chmod +x /entrypoint.sh
|
||||||
&& chown -R bitwarden:bitwarden /app \
|
|
||||||
&& mkdir /bitwarden \
|
|
||||||
&& chown -R bitwarden:bitwarden /bitwarden
|
|
||||||
|
|
||||||
USER bitwarden
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
@ -164,6 +164,9 @@ SA_PASSWORD=SECRET
|
|||||||
}
|
}
|
||||||
|
|
||||||
Helpers.Exec("chmod 600 /bitwarden/env/mssql.override.env");
|
Helpers.Exec("chmod 600 /bitwarden/env/mssql.override.env");
|
||||||
|
|
||||||
|
using(var sw = File.CreateText("/bitwarden/env/uid.env"))
|
||||||
|
{ }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
util/Setup/entrypoint.sh
Normal file
14
util/Setup/entrypoint.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
useradd -r -u ${LOCAL_UID:-999} -g bitwarden bitwarden
|
||||||
|
|
||||||
|
chown -R bitwarden:bitwarden /app
|
||||||
|
mkdir -p /bitwarden/env
|
||||||
|
mkdir -p /bitwarden/docker
|
||||||
|
mkdir -p /bitwarden/ssl
|
||||||
|
mkdir -p /bitwarden/letsencrypt
|
||||||
|
mkdir -p /bitwarden/identity
|
||||||
|
mkdir -p /bitwarden/nginx
|
||||||
|
chown -R bitwarden:bitwarden /bitwarden
|
||||||
|
|
||||||
|
exec /usr/local/bin/gosu bitwarden:bitwarden "$@"
|
Loading…
x
Reference in New Issue
Block a user