proper-website-2/Dockerfile
DutchEllie 3ade18b568
All checks were successful
continuous-integration/drone/push Build is passing
I am dumb
2022-03-13 19:37:32 +01:00

24 lines
570 B
Docker

FROM golang:1.17.8-alpine AS builder
WORKDIR /project
ADD . /project/
RUN go mod tidy
RUN GOARCH=wasm GOOS=js go build -o web/app.wasm
RUN go build -o app
FROM alpine:latest AS staging
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /project/web ./web/
COPY --from=builder /project/app ./
EXPOSE 8000
ENV TESTING true
CMD ["./app"]
FROM alpine:latest AS production
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /project/web ./web/
COPY --from=builder /project/app ./
EXPOSE 8000
ENV TESTING false
CMD ["./app"]