-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 863 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (24 loc) · 863 Bytes
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
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG VERSION=0.0.0-dev
ARG BUILD_TIME=unknown
ARG XRAY_VERSION=v26.2.6
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \
-ldflags "-X github.com/hteppl/remnawave-node-go/internal/version.Version=${VERSION} -X github.com/hteppl/remnawave-node-go/internal/version.BuildTime=${BUILD_TIME} -w -s" \
-o remnawave-node-go ./cmd/node-go
FROM alpine:3.21
RUN apk add --no-cache ca-certificates curl tzdata unzip
WORKDIR /app
COPY --from=builder /app/remnawave-node-go .
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV XRAY_VERSION=${XRAY_VERSION}
ENV XRAY_LOCATION_ASSET=/usr/local/share/xray
EXPOSE 2222
ENTRYPOINT ["/entrypoint.sh"]
CMD ["./remnawave-node-go"]