1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01: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

@ -105,4 +105,8 @@ csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_anonymous_types = true
# All files
[*]
guidelines = 120

View File

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

View File

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

View File

@ -6,6 +6,14 @@ namespace Billing.Controllers
{
public class HomeController : Controller
{
[HttpGet("~/alive")]
[HttpGet("~/now")]
[AllowAnonymous]
public DateTime GetAlive()
{
return DateTime.UtcNow;
}
/*
[Authorize]
public IActionResult Index()

View File

@ -32,6 +32,14 @@ namespace Bit.Events.Controllers
_cipherRepository = cipherRepository;
}
[HttpGet("~/alive")]
[HttpGet("~/now")]
[AllowAnonymous]
public DateTime GetAlive()
{
return DateTime.UtcNow;
}
[HttpPost]
public async Task<IActionResult> Post([FromBody]IEnumerable<EventModel> model)
{

View File

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

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/google.com/icon.png || exit 1
ENTRYPOINT ["/entrypoint.sh"]

View File

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

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"]