build: add project dockerfile (#2)

Add a project Dockerfile to allow deploying the application in a docker
container. Add a `run.sh` script to start the application in the container.
Add Makefile commands to build the docker image based on the Dockerfile.
Fix possible nil reference error in the `db` package.
This commit is contained in:
Hector
2021-02-07 13:04:24 +00:00
parent e94143e81c
commit 9dc8dd862f
4 changed files with 30 additions and 3 deletions

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
# Using golang:latest instead of alpine because of issues with sqlite3
FROM golang:latest
WORKDIR /app
COPY dist/fail2ban-prometheus-exporter_linux_amd64/fail2ban-prometheus-exporter /app
COPY docker/run.sh /app
RUN chmod +x /app/*
ENTRYPOINT /app/run.sh