forked from l7mp/stunner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (30 loc) · 742 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
###########
# BUILD
FROM golang:1.23-alpine as builder
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
COPY *.go ./
COPY internal/ internal/
COPY pkg/ pkg/
COPY cmd/ cmd/
COPY .git ./
COPY Makefile ./
RUN apk add --no-cache git make
RUN apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
aarch64) export GOARCH='arm64' ;; \
*) export GOARCH='amd64' ;; \
esac; \
export CGO_ENABLED=0; \
export GOOS=linux; \
make build-bin
###########
# STUNNERD
FROM scratch
WORKDIR /app
COPY --from=builder /app/bin/stunnerd /usr/bin/
COPY --from=builder /app/cmd/stunnerd/stunnerd.conf /
EXPOSE 3478/udp
CMD [ "stunnerd", "-c", "/stunnerd.conf" ]
# CMD [ "stunnerd", "turn://user1:[email protected]:3478" ]