Add Dockerfile

This commit is contained in:
TwinProduction 2019-09-14 19:25:59 -04:00
parent 88c35e30b4
commit fb93c33966
5 changed files with 35 additions and 9 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
examples
.github

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
# Build the go application into a binary
FROM golang:alpine as builder
WORKDIR /app
ADD . ./
RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -installsuffix cgo -o gatus .
RUN apk --update add ca-certificates
# Run the binary on an empty container
FROM scratch
COPY --from=builder /app/gatus .
COPY --from=builder /app/config.yaml .
COPY --from=builder /app/static static/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ENV PORT 80
EXPOSE 80
ENTRYPOINT ["/gatus"]

View File

@ -1,11 +1,7 @@
# gatus (in progress) # gatus (in progress)
A service health dashboard in Go A service health dashboard in Go that is meant to be used as a docker
image with a custom configuration file.
## Draft
![draft](assets/draft.jpg)
## Usage ## Usage
@ -30,3 +26,15 @@ services:
``` ```
go test ./... -mod vendor go test ./... -mod vendor
``` ```
## Building with Docker
```
docker build . -t gatus
```
## Using in Production
See the [example](example) folder.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

View File

@ -23,10 +23,10 @@
</table> </table>
</div> </div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script> <script>
const OK = "<span class=\"badge badge-success\">&#10003;</span>&nbsp;"; const OK = "<span class=\"badge badge-success\">&#10003;</span>&nbsp;";
const NOK = "<span class=\"badge badge-danger\">X</span>&nbsp;"; const NOK = "<span class=\"badge badge-danger\">X</span>&nbsp;";