1
0
mirror of https://github.com/bitwarden/web synced 2025-12-06 00:03:28 +00:00

Update docker

This commit is contained in:
Vince Grassia
2022-02-26 18:14:31 -05:00
parent 98fb71fcb6
commit dbd70f687d
7 changed files with 76 additions and 61 deletions

46
docker/Dockerfile Normal file
View File

@@ -0,0 +1,46 @@
###############################################
# Build stage #
###############################################
FROM node:16-slim AS build
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /source
COPY . .
RUN npm ci
RUN npm run dist:oss:selfhost
###############################################
# App stage #
###############################################
FROM bitwarden/server:latest
LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_URLS http://+:5000
EXPOSE 5000
RUN mkdir -p /etc/bitwarden/web
RUN chown -R bitwarden:bitwarden /etc/bitwarden
COPY docker/confd/app-id.toml /etc/confd/conf.d/
COPY docker/confd/app-id.conf.tmpl /etc/confd/templates/
RUN wget -O /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64
RUN chmod +x /usr/local/bin/confd
# Copy app from build stage
WORKDIR /app
COPY --from=build /source/build ./
RUN chown -R bitwarden:bitwarden /app
# Copy entrypoint script and make it executable
COPY docker/entrypoint.sh /
RUN chmod +x /entrypoint.sh
USER bitwarden:bitwarden
HEALTHCHECK CMD curl -f http://localhost:5000 || exit 1
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,15 @@
{
"trustedFacets": [
{
"version": {
"major": 1,
"minor": 0
},
"ids": [
"{{ getenv "globalSettings__baseServiceUri__vault" "https://localhost" }}",
"ios:bundle-id:com.8bit.bitwarden",
"android:apk-key-hash:dUGFzUzf3lmHSLBDBIv+WaFyZMI"
]
}
]
}

6
docker/confd/app-id.toml Normal file
View File

@@ -0,0 +1,6 @@
[template]
src = "app-id.conf.tmpl"
dest = "/etc/bitwarden/web/app-id.json"
keys = [
"globalSettings__baseServiceUri__vault"
]

7
docker/entrypoint.sh Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
/usr/local/bin/confd -onetime -backend env
cp /etc/bitwarden/web/app-id.json /app/app-id.json
exec dotnet /bitwarden_server/Server.dll /contentRoot=/app /webRoot=. /serveUnknown=false /webVault=true