-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 752 Bytes
/
Copy pathDockerfile
File metadata and controls
39 lines (28 loc) · 752 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
30
31
32
33
34
35
36
37
38
39
ARG ARCH=
FROM ${ARCH}golang:1.21-bullseye as build-server
# Initialization
RUN mkdir -p /app
WORKDIR /app
# Dependencies
COPY go.mod ./
COPY go.sum .
RUN go mod download
COPY cmd ./cmd
COPY pkg ./pkg
COPY assets ./assets
RUN go build -o valetudo-telegram-bot ./cmd/valetudo-telegram-bot/main.go
FROM ${ARCH}debian:bullseye-slim
# Options
ENV TELEGRAM_BOT_TOKEN ""
ENV TELEGRAM_CHAT_IDS ""
ENV VALETUDO_URL ""
ENV TELEGRAM_DEBUG false
# Copy build results
WORKDIR /app
# This has to be done to be able to use https
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install ca-certificates -y
COPY --from=build-server /app/valetudo-telegram-bot ./valetudo-telegram-bot
# Start the application
ENTRYPOINT [ "./valetudo-telegram-bot" ]