generated from golang-templates/seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (46 loc) · 1.81 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Builder step compiles the application into standalone binary
FROM golang:latest AS builder
RUN mkdir /app
COPY go.mod /app/
COPY go.sum /app/
WORKDIR /app
RUN go mod download
COPY ./ /app
RUN CGO_ENABLED=0 go build -o crontab-go
RUN chmod +x crontab-go
# ──────────────────────────────────────────────────────────────────────────────
# Output debian slim version: has a shell to execute commands and can be extended
FROM debian:bookworm-slim AS slim
COPY --from=builder /app/crontab-go /bin/crontab-go
ENV LOG_TIMESTAMP_FORMAT="2006-01-02T15:04:05.000Z"
ENV LOG_FORMAT="ansi"
ENV LOG_FILE=
ENV LOG_STDOUT=true
ENV LOG_LEVEL="debug"
ENV SHELL="bash"
ENV SHELL_ARGS="-c"
ENV WEBSERVER_ADDRESS=
ENV WEBSERVER_PORT=
ENV WEBSERVER_USERNAME=
ENV WEBSERVER_PASSWORD=
ENTRYPOINT ["/bin/crontab-go" ]
CMD ["-c","/config.yaml"]
# ──────────────────────────────────────────────────────────────────────────────
# Output debian static distroless: does not have a shell, you are able to use GET,POST tasks
# But you are able to attach to docker instance and execute commands there
FROM gcr.io/distroless/static-debian12:latest-amd64 AS static
COPY --from=builder /app/crontab-go /crontab-go
ENV LOG_TIMESTAMP_FORMAT="2006-01-02T15:04:05.000Z"
ENV LOG_FORMAT="ansi"
ENV LOG_FILE=
ENV LOG_STDOUT=true
ENV LOG_LEVEL="debug"
ENV SHELL="static tag does not have a shell"
ENV SHELL_ARGS=""
ENV WEBSERVER_ADDRESS=
ENV WEBSERVER_PORT=
ENV WEBSERVER_USERNAME=
ENV WEBSERVER_PASSWORD=
WORKDIR /
ENTRYPOINT ["/crontab-go" ]
CMD ["-c","/config.yaml"]