-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (24 loc) · 768 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
43
44
FROM golang:1.21.3-alpine3.18 AS backend-builder-base-compiler
RUN apk --no-cache add build-base
FROM backend-builder-base-compiler AS backend-builder-base
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
FROM backend-builder-base AS backend-builder
WORKDIR /build
COPY . .
ENV CGO_ENABLED=1 GOARCH=amd64 GOOS=linux
RUN go build -o wireguard-admin .
FROM node:20.12.2-alpine3.18 as frontend-builder
WORKDIR /build
COPY ui /build
RUN yarn &&\
yarn build
FROM alpine:3.18 as base
RUN apk --no-cache add ca-certificates wireguard-tools iptables &&\
rm -rf /var/cache/apk/*
FROM base
WORKDIR /app
COPY --from=backend-builder /build/wireguard-admin .
COPY --from=frontend-builder /build/dist ./public
ENTRYPOINT ["./wireguard-admin"]