Skip to content

Commit e2ac284

Browse files
committed
docker: update build file
1 parent 51158cc commit e2ac284

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM node:13-alpine as ui-build
22
COPY web /tmp/web
33
WORKDIR /tmp/web
4-
ARG APP_VERSION="1.0.0"
5-
ARG GITHUB_URL="https://github.com/x1unix/go-playground"
4+
ARG APP_VERSION=1.0.0
5+
ARG GITHUB_URL=https://github.com/x1unix/go-playground
66
RUN yarn install --silent && REACT_APP_VERSION=$APP_VERSION REACT_APP_GITHUB_URL=$GITHUB_URL yarn build
77

88
FROM golang:1.13-alpine as build
@@ -11,7 +11,9 @@ COPY cmd ./cmd
1111
COPY pkg ./pkg
1212
COPY go.mod .
1313
COPY go.sum .
14-
RUN go build -o server ./cmd/playground
14+
RUN go build -o server ./cmd/playground && \
15+
GOOS=js GOARCH=wasm go build -o ./worker.wasm ./cmd/webworker && \
16+
cp $(go env GOROOT)/misc/wasm/wasm_exec.js .
1517

1618
FROM golang:1.13-alpine as production
1719
WORKDIR /opt/playground
@@ -21,5 +23,7 @@ ENV APP_DEBUG=false
2123
COPY data ./data
2224
COPY --from=ui-build /tmp/web/build ./public
2325
COPY --from=build /tmp/playground/server .
26+
COPY --from=build /tmp/playground/worker.wasm ./public
27+
COPY --from=build /tmp/playground/wasm_exec.js ./public
2428
EXPOSE 8000
2529
ENTRYPOINT /opt/playground/server -f=/opt/playground/data/packages.json -addr=:8000 -clean-interval=${APP_CLEAN_INTERVAL} -debug=${APP_DEBUG}

0 commit comments

Comments
 (0)