Dockerfile 498 B

12345678910111213141516171819
  1. FROM node:slim as jsbuild
  2. RUN npm install -g typescript prettier
  3. WORKDIR /src
  4. FROM golang:alpine as gobuild
  5. WORKDIR /src
  6. COPY go.mod go.sum ./
  7. RUN go mod download
  8. COPY . /src
  9. RUN GOOS=js GOARCH=wasm go build -o ./web/webwormhole.wasm ./web
  10. RUN cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./web/wasm_exec.js
  11. RUN go build ./cmd/ww
  12. FROM alpine:latest
  13. RUN apk --no-cache add ca-certificates
  14. COPY --from=gobuild /src/ww /bin
  15. COPY --from=gobuild /src/web /web
  16. WORKDIR /
  17. ENTRYPOINT ["/bin/ww", "server"]