Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ COPY pkg ./pkg
COPY internal ./internal
COPY go.mod .
COPY go.sum .

## wasm_exec.js files are left for backwards compatibility for old clients.
RUN echo "Building server with version $APP_VERSION" && \
go build -o server -ldflags="-X 'main.Version=$APP_VERSION'" ./cmd/playground && \
GOOS=js GOARCH=wasm go build \
-buildvcs=false \
-ldflags "-s -w" \
-trimpath \
-o ./go-repl@$WASM_API_VER.wasm ./cmd/wasm/go-repl && \
-buildvcs=false \
-ldflags "-s -w" \
-trimpath \
-o ./go-repl@$WASM_API_VER.wasm ./cmd/wasm/go-repl && \
GOOS=js GOARCH=wasm go build \
-buildvcs=false \
-ldflags "-s -w" \
-trimpath \
-o ./analyzer@$WASM_API_VER.wasm ./cmd/wasm/analyzer
-buildvcs=false \
-ldflags "-s -w" \
-trimpath \
-o ./analyzer@$WASM_API_VER.wasm ./cmd/wasm/analyzer && \
cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./wasm_exec@v2.js && \
cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./wasm_exec.js

FROM golang:${GO_VERSION}-alpine as production
ARG GO_VERSION
Expand All @@ -61,6 +65,7 @@ COPY data ./data
COPY --from=ui-build /tmp/web/build ./public
COPY --from=build /tmp/playground/server .
COPY --from=build /tmp/playground/*.wasm ./public/wasm/
COPY --from=build /tmp/playground/*.js ./public/wasm/
EXPOSE 8000
ENTRYPOINT /opt/playground/server \
-f='/opt/playground/data/packages.json' \
Expand Down
7 changes: 6 additions & 1 deletion build/release.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ COPY pkg ./pkg
COPY internal ./internal
COPY go.mod .
COPY go.sum .

## wasm_exec.js files are left for backwards compatibility for old clients.
RUN echo "Building server with version $APP_VERSION" && \
go build -o server -ldflags="-X 'main.Version=$APP_VERSION'" ./cmd/playground && \
GOOS=js GOARCH=wasm go build \
Expand All @@ -32,7 +34,9 @@ RUN echo "Building server with version $APP_VERSION" && \
-buildvcs=false \
-ldflags "-s -w" \
-trimpath \
-o ./analyzer@$WASM_API_VER.wasm ./cmd/wasm/analyzer
-o ./analyzer@$WASM_API_VER.wasm ./cmd/wasm/analyzer && \
cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./wasm_exec@v2.js && \
cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./wasm_exec.js

FROM golang:${GO_VERSION}-alpine as production
ARG GO_VERSION
Expand All @@ -47,6 +51,7 @@ COPY data ./data
COPY web/build ./public
COPY --from=build /tmp/playground/server .
COPY --from=build /tmp/playground/*.wasm ./public/wasm/
COPY --from=build /tmp/playground/*.js ./public/wasm/
EXPOSE 8000
ENTRYPOINT /opt/playground/server \
-f='/opt/playground/data/packages.json' \
Expand Down