forked from passwall/passwall-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (21 loc) · 797 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
FROM golang:1.20-alpine AS builder
WORKDIR /app
RUN apk add gcc g++ ca-certificates --no-cache
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY ./cmd ./cmd
COPY ./internal ./internal
COPY ./model ./model
COPY ./pkg ./pkg
COPY ./public ./public
RUN mkdir store
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -a -ldflags '-s -w -extldflags "-static"' ./cmd/passwall-server
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -a -ldflags '-s -w -extldflags "-static"' ./cmd/passwall-cli
FROM alpine:latest
WORKDIR /app
# ENV PW_DIR=/app/store
ENTRYPOINT ["/app/passwall-server"]
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /app/passwall-server /app/passwall-server
COPY --from=builder /app/passwall-cli /app/passwall-cli