Skip to content
Snippets Groups Projects
Unverified Commit 665455d3 authored by Joona Hoikkala's avatar Joona Hoikkala Committed by GitHub
Browse files

Docker instructions and configuration (#33)

* Added dockerfile

* Docker configuration

* Added Docker images, composer configuration and documentation
parent c5337fc8
No related branches found
No related tags found
No related merge requests found
FROM golang:1.9.2-alpine AS builder
LABEL maintainer="joona@kuori.org"
RUN apk add --update gcc musl-dev git
RUN go get github.com/joohoi/acme-dns
WORKDIR /go/src/github.com/joohoi/acme-dns
RUN CGO_ENABLED=1 go build
FROM alpine:latest
WORKDIR /root/
COPY --from=builder /go/src/github.com/joohoi/acme-dns .
RUN mkdir -p /etc/acme-dns
RUN mkdir -p /var/lib/acme-dns
RUN rm -rf ./config.cfg
VOLUME ["/etc/acme-dns", "/var/lib/acme-dns"]
ENTRYPOINT ["./acme-dns"]
EXPOSE 53 80 443
...@@ -117,6 +117,35 @@ Check out how in the INSTALL section. ...@@ -117,6 +117,35 @@ Check out how in the INSTALL section.
5) Run acme-dns. Please note that acme-dns needs to open a privileged port (53, domain), so it needs to be run with elevated privileges. 5) Run acme-dns. Please note that acme-dns needs to open a privileged port (53, domain), so it needs to be run with elevated privileges.
## Using Docker
1) Pull the latest acme-dns Docker image: `docker pull joohoi/acme-dns`
2) Create directories: `config` for the configuration file, and `data` for the sqlite3 database.
3) Copy [configuration template](https://raw.githubusercontent.com/joohoi/acme-dns/master/config.cfg) to `config/config.cfg`
4) Modify the config.cfg to suit your needs.
5) Run Docker, this example expects that you have `port = "80"` in your config.cfg:
```
docker run --rm --name acmedns \
-p 53:53 \
-p 80:80 \
-v /path/to/your/config:/etc/acme-dns:ro \
-v /path/to/your/data:/var/lib/acme-dns \
-d joohoi/acme-dns
```
## Docker Compose
1) Create directories: `config` for the configuration file, and `data` for the sqlite3 database.
2) Copy [configuration template](https://raw.githubusercontent.com/joohoi/acme-dns/master/config.cfg) to `config/config.cfg`
3) Copy [docker-compose.yml from the project](https://raw.githubusercontent.com/joohoi/acme-dns/master/docker-compose.yml), or create your own.
4) Edit the `config/config.cfg` and `docker-compose.yml` to suit your needs, and run `docker-compose up -d`
## Configuration ## Configuration
......
...@@ -27,7 +27,8 @@ debug = false ...@@ -27,7 +27,8 @@ debug = false
# Database engine to use, sqlite3 or postgres # Database engine to use, sqlite3 or postgres
engine = "sqlite3" engine = "sqlite3"
# Connection string, filename for sqlite3 and postgres://$username:$password@$host/$db_name for postgres # Connection string, filename for sqlite3 and postgres://$username:$password@$host/$db_name for postgres
connection = "acme-dns.db" # Please note that the default Docker image uses path /var/lib/acme-dns/acme-dns.db for sqlite3
connection = "/var/lib/acme-dns/acme-dns.db"
# connection = "postgres://user:password@localhost/acmedns_db" # connection = "postgres://user:password@localhost/acmedns_db"
[api] [api]
...@@ -36,9 +37,9 @@ api_domain = "" ...@@ -36,9 +37,9 @@ api_domain = ""
# email to use for account registration for Let's Encrypt, used only if tls = "letsencrypt" # email to use for account registration for Let's Encrypt, used only if tls = "letsencrypt"
le_email = "admin@example.com" le_email = "admin@example.com"
# listen ip eg. 127.0.0.1 # listen ip eg. 127.0.0.1
ip = "127.0.0.1" ip = "0.0.0.0"
# listen port, eg. 443 for default HTTPS # listen port, eg. 443 for default HTTPS
port = "8080" port = "80"
# possible values: "letsencrypt", "cert", "none" # possible values: "letsencrypt", "cert", "none"
tls = "none" tls = "none"
# only used if tls = "cert" # only used if tls = "cert"
......
version: '2'
services:
acmedns:
build:
context: .
dockerfile: Dockerfile
image: joohoi/acme-dns:latest
ports:
- "443:443"
- "53:53"
- "80:80"
volumes:
- ./config:/etc/acme-dns:ro
- ./data:/var/lib/acme-dns
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment