From bdc837d03f7c35193e76b3e63a357c4ce1183165 Mon Sep 17 00:00:00 2001 From: mr-karan Date: Fri, 12 Jul 2019 07:24:33 +0530 Subject: [PATCH] feat: Create docker release - Updates `.goreleaser.yml` to add docker build step - Adds `Dockerfile` for listmonk - Adds `docker-compose.yml` for reference. --- .goreleaser.yml | 12 ++++++++++++ Dockerfile | 6 ++++++ docker-compose.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.goreleaser.yml b/.goreleaser.yml index d344779..649d0bf 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -27,3 +27,15 @@ archives: - config.toml.sample - README.md - LICENSE +dockers: + - + goos: linux + goarch: amd64 + binaries: + - listmonk + image_templates: + - "knadh/listmonk:latest" + - "knadh/listmonk:{{ .Tag }}" + dockerfile: Dockerfile + extra_files: + - config.toml.sample diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6b55692 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM alpine:latest AS deploy +RUN apk --no-cache add ca-certificates +COPY listmonk / +COPY config.toml.sample /etc/listmonk/config.toml +VOLUME ["/etc/listmonk"] +CMD ["./listmonk", "--config", "/etc/listmonk/config.toml"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e093f31 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,42 @@ +# NOTE: This docker-compose.yml is meant to be just an example guideline +# on how you can achieve the same. It is not intented to run out of the box +# and you must edit the below configurations to suit your needs. + +version: "3.7" + +services: + db: + image: postgres:11 + ports: + - "5432:5432" + volumes: + - type: volume + source: listmonk-data + target: /var/lib/postgresql/data + networks: + - listmonk + environment: + - POSTGRES_PASSWORD=listmonk + - POSTGRES_USER=listmonk + - POSTGRES_DB=listmonk + restart: unless-stopped + + app: + restart: unless-stopped + depends_on: + - db + image: knadh/listmonk:latest + volumes: + - type: bind + source: ./config.toml + target: /etc/listmonk/config.toml + ports: + - "9000:9000" + networks: + - listmonk + +networks: + listmonk: + +volumes: + listmonk-data: