1# Run this dockerfile from the top level of the indigo git repository like:
2#
3# podman build -f ./cmd/bigsky/Dockerfile -t bigsky .
4
5### Compile stage
6FROM golang:1.24-alpine3.22 AS build-env
7RUN apk add --no-cache build-base make git
8
9ADD . /dockerbuild
10WORKDIR /dockerbuild
11
12# timezone data for alpine builds
13ENV GOEXPERIMENT=loopvar
14RUN GIT_VERSION=$(git describe --tags --long --always) && \
15 echo "replace github.com/gocql/gocql => github.com/scylladb/gocql v1.14.4" >> go.mod && \
16 go mod tidy && \
17 go build -tags timetzdata,scylla -o /bigsky ./cmd/bigsky
18
19### Build Frontend stage
20FROM node:18-alpine as web-builder
21
22WORKDIR /app
23
24COPY ts/bgs-dash /app/
25
26RUN yarn install --frozen-lockfile
27
28RUN yarn build
29
30### Run stage
31FROM alpine:3.22
32
33RUN apk add --no-cache --update dumb-init ca-certificates runit
34ENTRYPOINT ["dumb-init", "--"]
35
36WORKDIR /
37RUN mkdir -p data/bigsky
38COPY --from=build-env /bigsky /
39COPY --from=web-builder /app/dist/ public/
40
41# small things to make golang binaries work well under alpine
42ENV GODEBUG=netdns=go
43ENV TZ=Etc/UTC
44
45EXPOSE 2470
46
47CMD ["/bigsky"]
48
49LABEL org.opencontainers.image.source=https://github.com/bluesky-social/indigo
50LABEL org.opencontainers.image.description="ATP Relay (aka BGS)"
51LABEL org.opencontainers.image.licenses=MIT