-
-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathDockerfile.nps
More file actions
executable file
·23 lines (22 loc) · 767 Bytes
/
Dockerfile.nps
File metadata and controls
executable file
·23 lines (22 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM golang:latest AS builder
# ARG GOPROXY=direct
ARG GOPROXY=https://proxy.golang.org
WORKDIR /go/src/github.com/djylb/nps
COPY . .
RUN go mod edit -go=$(go version | awk '{print $3}' | sed 's/go//') && \
go mod tidy && \
go get -d -v ./...
RUN CGO_ENABLED=0 go build -ldflags="-w -s -extldflags -static" ./cmd/nps/nps.go
RUN mkdir -p /app && \
mkdir -p /app/web && \
cp ./nps /app/ && \
cp -r ./web/static /app/web/ && \
cp -r ./web/views /app/web/ && \
cp ./conf/nps.conf /app/nps.conf.sample && \
cp ./entrypoint.nps.sh /app/entrypoint.sh && \
chmod +x /app/entrypoint.sh
FROM alpine
RUN apk add --no-cache tzdata nano ca-certificates && update-ca-certificates
COPY --from=builder /app/ /
VOLUME /conf
CMD ["/entrypoint.sh"]