diff --git a/infrastructure/cloudformation/dt/task.yaml b/infrastructure/cloudformation/dt/task.yaml index 0de2430..498f09b 100644 --- a/infrastructure/cloudformation/dt/task.yaml +++ b/infrastructure/cloudformation/dt/task.yaml @@ -36,6 +36,9 @@ Resources: - HostPort: 0 ContainerPort: 7777 Protocol: udp + - HostPort: 0 + ContainerPort: 80 + Protocol: tcp LogConfiguration: LogDriver: awslogs Options: diff --git a/server/Dockerfile b/server/Dockerfile index 7c6cc7f..ea72233 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -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,12 @@ 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 systemctl enable nginx.service + +EXPOSE 80/tcp EXPOSE 7777/udp \ No newline at end of file diff --git a/server/nginx.conf b/server/nginx.conf new file mode 100644 index 0000000..1477c33 --- /dev/null +++ b/server/nginx.conf @@ -0,0 +1,10 @@ +server { + location / { + root /usr/share/nginx/html; + } + + location /health { + return 200 'alive'; + add_header Content-Type text/plain; + } +} \ No newline at end of file