-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (38 loc) · 1.41 KB
/
Dockerfile
File metadata and controls
58 lines (38 loc) · 1.41 KB
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
# ------------------------------------------------------------
FROM golang:1.22 AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG VERSION
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X go.virtualstaticvoid.com/metadock/Version=${VERSION}" -o /metadock .
# ------------------------------------------------------------
FROM alpine:3.20 AS base
RUN apk add --no-cache tini curl
# ------------------------------------------------------------
FROM base AS app
RUN mkdir -p /opt/metadock/bin/
COPY --from=builder --chmod=755 /metadock /opt/metadock/bin/
COPY README.md LICENSE /opt/metadock/
ENV PORT=80
HEALTHCHECK --interval=5s \
CMD curl -sSfL http://127.0.0.1:${PORT}/health/ > /dev/null
ENTRYPOINT ["/sbin/tini", "--", "/opt/metadock/bin/metadock"]
CMD ["default"]
# ------------------------------------------------------------
FROM ubuntu:24.04 AS test
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -qq \
&& apt-get install -qy --no-install-recommends \
ca-certificates \
curl \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o awscli-exe-linux.zip \
&& tmpdir=$(mktemp -d) \
&& unzip -q awscli-exe-linux.zip -d "${tmpdir}" \
&& "${tmpdir}/aws/install" \
&& rm -rf awscli-exe-linux.zip "${tmpdir}"
COPY --chmod=755 test.sh /test.sh
CMD ["sleep", "infinity"]