1
0
mirror of https://github.com/bitwarden/web synced 2026-01-07 19:13:21 +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"]