2022-03-12 16:22:41 +01:00
|
|
|
FROM golang:1.17.8-alpine AS builder
|
2022-03-13 20:18:07 +01:00
|
|
|
ARG APIURL
|
2022-03-12 16:22:41 +01:00
|
|
|
WORKDIR /project
|
|
|
|
ADD . /project/
|
|
|
|
RUN go mod tidy
|
2022-03-13 20:18:07 +01:00
|
|
|
RUN GOARCH=wasm GOOS=js go build -ldflags="-X 'dutchellie.nl/DutchEllie/proper-website-2/components.ApiURL=$APIURL'" -o web/app.wasm
|
|
|
|
RUN go build -ldflags="-X 'dutchellie.nl/DutchEllie/proper-website-2/components.ApiURL=$APIURL'" -o app
|
2022-03-12 16:22:41 +01:00
|
|
|
|
2022-03-13 19:34:20 +01:00
|
|
|
FROM alpine:latest AS staging
|
2022-03-12 16:22:41 +01:00
|
|
|
RUN apk --no-cache add ca-certificates
|
|
|
|
WORKDIR /root/
|
|
|
|
COPY --from=builder /project/web ./web/
|
|
|
|
COPY --from=builder /project/app ./
|
|
|
|
EXPOSE 8000
|
2022-03-13 19:37:32 +01:00
|
|
|
ENV TESTING true
|
2022-03-13 19:34:20 +01:00
|
|
|
CMD ["./app"]
|