# build
FROM golang:1-alpine AS build
WORKDIR /alps

RUN apk add --no-cache git make && \
    git clone https://git.sr.ht/~migadu/alps . && \
    CGO_ENABLED=0 make all

# release
FROM alpine:3 AS release
WORKDIR /

COPY --from=build ./build/alps ./alps
COPY ./init ./init

LABEL org.opencontainers.image.source=https://git.nemunai.re/nemunaire/docker-alps

EXPOSE 1323

HEALTHCHECK CMD wget --spider http://127.0.0.1:1323/

ENTRYPOINT ["/init"]
