1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-28 00:02:26 -05:00
2023-11-09 17:07:47 -05:00

33 lines
973 B
Docker

###############################################
# Build stage #
###############################################
ARG BUILD_TAG=latest
FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build
###############################################
# App stage #
###############################################
FROM mcr.microsoft.com/dotnet/aspnet:6.0
ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS http://+:5000
EXPOSE 5000
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gosu \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy app from the build stage
WORKDIR /bitwarden_server
COPY --from=bitwarden-build /app/Server ./
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
HEALTHCHECK CMD curl -f http://localhost:5000/alive || exit 1
ENTRYPOINT ["/entrypoint.sh"]