-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 713 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 713 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
FROM golang:alpine AS builder
WORKDIR /builder/
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -o passphrasebot .
FROM alpine
WORKDIR /app/
COPY --from=builder /builder/passphrasebot .
RUN mkdir /secret/
# Run with
# docker run --mount type=bind,source=/etc/secret/,target=/secret/,readonly 123
# Optional parameter, this .env file will be used only if --mount is not specified.
# docker run --mount type=bind,source=/etc/secret/,target=/secret/,readonly -d --name container-name 123
# if you have .env file in the /etc/secret on the docker host. Otherwise
# docker run -d --name container-name 123
COPY --from=builder /builder/.env /secret/
WORKDIR /app/
CMD [ "./passphrasebot" ]