feat: Create docker release

- Updates `.goreleaser.yml` to add docker build step
- Adds `Dockerfile` for listmonk
- Adds `docker-compose.yml` for reference.
This commit is contained in:
mr-karan 2019-07-12 07:24:33 +05:30
parent 714a040295
commit bdc837d03f
3 changed files with 60 additions and 0 deletions

View File

@ -27,3 +27,15 @@ archives:
- config.toml.sample - config.toml.sample
- README.md - README.md
- LICENSE - LICENSE
dockers:
-
goos: linux
goarch: amd64
binaries:
- listmonk
image_templates:
- "knadh/listmonk:latest"
- "knadh/listmonk:{{ .Tag }}"
dockerfile: Dockerfile
extra_files:
- config.toml.sample

6
Dockerfile Normal file
View File

@ -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"]

42
docker-compose.yml Normal file
View File

@ -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: