FROM golang:1.19-alpine

RUN mkdir -p /go/src/git.tovijaeschke.xyz/Capsule/Backend

COPY ./ /go/src/git.tovijaeschke.xyz/Capsule/Backend

WORKDIR /go/src/git.tovijaeschke.xyz/Capsule/Backend

# For "go test"
RUN apk add gcc libc-dev

RUN go mod download

RUN go build -o /go/bin/capsule-server main.go

CMD [ "/go/bin/capsule-server" ]
