1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

health checks for docker

This commit is contained in:
Kyle Spearrin
2019-07-26 11:59:42 -04:00
parent d9d2dea784
commit f78b212aa8
10 changed files with 49 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Bit.Core.Utilities;
@ -19,6 +20,14 @@ namespace Bit.Notifications
_hubContext = hubContext;
}
[HttpGet("~/alive")]
[HttpGet("~/now")]
[AllowAnonymous]
public DateTime GetAlive()
{
return DateTime.UtcNow;
}
[HttpPost("~/send")]
public async Task PostSend()
{

View File

@ -5,6 +5,7 @@ LABEL com.bitwarden.product="bitwarden"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gosu \
curl \
&& rm -rf /var/lib/apt/lists/*
ENV ASPNETCORE_URLS http://+:5000
@ -14,4 +15,6 @@ COPY obj/Docker/publish .
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
HEALTHCHECK CMD curl -f http://localhost:5000/alive || exit 1
ENTRYPOINT ["/entrypoint.sh"]