-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathDockerfile
36 lines (22 loc) · 836 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
34
35
36
# syntax=docker/dockerfile:1
# --- builder ---
FROM golang:1.22 as builder
RUN GO111MODULE=on
RUN mkdir /app
WORKDIR /app/insights-bot
COPY go.mod /app/insights-bot/go.mod
COPY go.sum /app/insights-bot/go.sum
RUN go env
RUN go env -w CGO_ENABLED=0
RUN go mod download
COPY . /app/insights-bot
RUN go build -a -o "release/insights-bot" "github.com/nekomeowww/insights-bot/cmd/insights-bot"
# --- runner ---
FROM debian as runner
RUN apt update && apt upgrade -y && apt install -y ca-certificates curl && update-ca-certificates
COPY --from=builder /app/insights-bot/release/insights-bot /usr/local/bin/
COPY --from=builder /app/insights-bot/locales /etc/insights-bot/locales
ENV LOG_FILE_PATH /var/log/insights-bot/insights-bot.log
ENV LOCALES_DIR /etc/insights-bot/locales
EXPOSE 7069
CMD [ "/usr/local/bin/insights-bot" ]