feat: init container

This commit is contained in:
Fred Liang 2021-09-25 18:29:17 +08:00
commit 47416c3ba2
3 changed files with 25 additions and 0 deletions

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM golang:latest AS builder
WORKDIR /app
# https://tailscale.com/kb/1118/custom-derp-servers/
RUN go install tailscale.com/cmd/derper@main
FROM ubuntu
WORKDIR /app
ENV DEPR_HOSTNAME your-hostname.com
COPY --from=builder /go/bin/derper .
COPY entrypoint.sh /app/entrypoint.sh
CMD ["/app/derper", "--hostname", "${DEPR_HOSTNAME}"]

9
README.md Normal file
View file

@ -0,0 +1,9 @@
# Derper
# Setup
> required: set env `DEPR_HOSTNAME` to your domain
```bash
docker run -e DEPR_HOSTNAME=derper.your-domain.com fredliang/derper
```

2
entrypoint.sh Normal file
View file

@ -0,0 +1,2 @@
#!/bin/sh
/app/derper --hostname ${DEPR_HOSTNAME}