Self-hosted tailscale derper based on alpine docker image
292
derp:
image: stanhu86/derper:latest
container_name: derp
restart: unless-stopped
user: "${UID_GID}"
ports:
- "3478:3478/udp"
- "443:443"
- "80:80"
volumes:
- ./derp/certs:/app/certs
environment:
- DERP_CONFIG=/app/certs/derper.key
- DERP_DOMAIN=your-domain.com
| env | required | description | default value |
|---|---|---|---|
| DERP_CONFIG | false | derp config file | /var/lib/derper/derper.key |
| DERP_DOMAIN | true | derper server hostname | your-hostname.com |
| DERP_CERT_DIR | false | directory to store LetsEncrypt certs(if addr's port is :443) | /app/certs |
| DERP_CERT_MODE | false | mode for getting a cert. possible options: manual, letsencrypt | letsencrypt |
| DERP_ADDR | false | listening server address | :443 |
| DERP_STUN | false | also run a STUN server | true |
| DERP_STUN_PORT | false | The UDP port on which to serve STUN. | 3478 |
| DERP_HTTP_PORT | false | The port on which to serve HTTP. Set to -1 to disable | 80 |
| DERP_VERIFY_CLIENTS | false | verify clients to this DERP server through a local tailscaled instance | false |
| DERP_VERIFY_CLIENT_URL | false | if non-empty, an admission controller URL for permitting client connections | "" |
ARG GOLANG_VERSION=1.25
ARG ALPINE_VERSION=3.22
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS builder
WORKDIR /go/src
ARG DERP_VERSION=v1.88.2
RUN go install -ldflags "-w -s" -trimpath tailscale.com/cmd/derper@${DERP_VERSION}
FROM alpine:${ALPINE_VERSION}
WORKDIR /app
RUN set -eux; \
apk add --update --no-cache ca-certificates tini; \
apk del openssl apk-tools; \
mkdir /app/certs
ENV DERP_CONFIG /var/lib/derper/derper.key
ENV DERP_DOMAIN your-domain.com
ENV DERP_CERT_MODE letsencrypt
ENV DERP_CERT_DIR /app/certs
ENV DERP_ADDR :443
ENV DERP_STUN true
ENV DERP_STUN_PORT 3478
ENV DERP_HTTP_PORT 80
ENV DERP_VERIFY_CLIENTS false
ENV DERP_VERIFY_CLIENT_URL ""
COPY --from=builder /go/bin/derper .
ENTRYPOINT [ "/sbin/tini", "--" ]
CMD /app/derper \
-c ${DERP_CONFIG} \
--hostname=${DERP_DOMAIN} \
--certmode=${DERP_CERT_MODE} \
--certdir=${DERP_CERT_DIR} \
--a=${DERP_ADDR} \
--stun=${DERP_STUN} \
--stun-port=${DERP_STUN_PORT} \
--http-port=${DERP_HTTP_PORT} \
--verify-clients=${DERP_VERIFY_CLIENTS} \
--verify-client-url=${DERP_VERIFY_CLIENT_URL}
Content type
Image
Digest
sha256:40fdb9270…
Size
10.1 MB
Last updated
about 1 month ago
docker pull stanhu86/derper