-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 874 Bytes
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 874 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
FROM golang:1.24.9-bookworm AS indexer
RUN set -ex; \
apt-get update; \
apt-get install -y build-essential bash git make gcc ca-certificates g++; \
rm -rf /var/lib/apt/lists/*;
WORKDIR /indexer
# Download dependencies - will be cached if go.mod/go.sum doesn't change
COPY go.mod ./
COPY go.sum ./
RUN go mod download
# Set APP to control which binaries are built into the container
ARG APP
COPY . ./
RUN if [ -z "$APP" ]; then \
make build-all; \
else \
APP="$APP" make build-app; \
fi
# ----------------------
FROM debian:bookworm-slim
RUN apt-get update && \
apt-get install -y ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY --from=indexer /indexer/bin/* /usr/bin/
# no default here
ARG APP
ENV APP=${APP}
ENTRYPOINT ["/bin/sh","-c","exec /usr/bin/${APP:?set APP env to a service name} \"$@\"","--"]
CMD ["run"]