-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (38 loc) · 2.03 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (38 loc) · 2.03 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
FROM golang:1.25-alpine AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /bin/api ./cmd/api && \
CGO_ENABLED=0 go build -o /bin/relay ./cmd/relay && \
CGO_ENABLED=0 go build -o /bin/worker ./cmd/worker && \
CGO_ENABLED=0 go build -o /bin/ingest ./cmd/ingest && \
CGO_ENABLED=0 go build -o /bin/migrate ./cmd/migrate && \
CGO_ENABLED=0 go build -o /bin/cleanup ./cmd/cleanup
# ─── runtime ────────────────────────────────────────────────────────────────
FROM metabrainz/consul-template-base:noble-1.0.2-v0.3-2
ARG GIT_COMMIT_SHA
LABEL org.label-schema.vcs-url="https://github.com/metabrainz/synapse.git" \
org.label-schema.vcs-ref="" \
org.label-schema.schema-version="1.0.0-rc1" \
org.label-schema.vendor="MetaBrainz Foundation" \
org.label-schema.name="Synapse" \
org.metabrainz.based-on-image="metabrainz/consul-template-base:noble-1.0.2-v0.3-2"
LABEL org.label-schema.vcs-ref=$GIT_COMMIT_SHA
ENV GIT_SHA=${GIT_COMMIT_SHA}
COPY --from=builder /bin/api /bin/api
COPY --from=builder /bin/relay /bin/relay
COPY --from=builder /bin/worker /bin/worker
COPY --from=builder /bin/ingest /bin/ingest
COPY --from=builder /bin/migrate /bin/migrate
COPY --from=builder /bin/cleanup /bin/cleanup
COPY migrations /migrations
RUN mkdir -p /etc/synapse
COPY deploy/config.yaml.ctmpl /etc/synapse/config.yaml.ctmpl
COPY deploy/consul-template-api.conf /etc/synapse/consul-template-api.conf
COPY deploy/consul-template-worker.conf /etc/synapse/consul-template-worker.conf
COPY deploy/consul-template-relay.conf /etc/synapse/consul-template-relay.conf
COPY deploy/consul-template-ingest.conf /etc/synapse/consul-template-ingest.conf
COPY deploy/run-synapse-command /usr/local/bin/run-synapse-command
ENTRYPOINT ["consul-template"]
CMD ["-config", "/etc/synapse/consul-template-api.conf"]