Configure endpoint for healthcheck

This commit is contained in:
Layla 2020-05-01 17:42:59 -04:00
parent 84f6ca7434
commit 5fbbfba593
No known key found for this signature in database
GPG Key ID: A494D9357BA1BE31
2 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,7 @@
FROM fedora:32
RUN /bin/bash -c "dnf install g++ enet-devel gtest gmock gmock-devel gtest-devel -y"
# Build and setup app
RUN dnf install g++ enet-devel gtest gmock gmock-devel gtest-devel -y
ADD / /dt
@ -8,4 +9,15 @@ RUN cd /dt; /dt/build.sh
CMD ["/dt/builds/server.out"]
# Setup status endpoint
RUN dnf install nginx -y
COPY nginx.conf /etc/nginx/conf.d/nginx.conf
RUN rm /etc/nginx/conf.d/default.conf
RUN systemctl start nginx.service
EXPOSE 80/tcp
EXPOSE 7777/udp

10
server/nginx.conf Normal file
View File

@ -0,0 +1,10 @@
server {
location / {
root /usr/share/nginx/html;
}
location /health {
return 200 'alive';
add_header Content-Type text/plain;
}
}