diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4efd0346c..4ac397101 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,4 +124,23 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max tags: ${{ steps.meta-metrics.outputs.tags }} - labels: ${{ steps.meta-metrics.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta-metrics.outputs.labels }} + + # Sandbox GUI + + - name: GUI image tags & labels + id: meta-gui + uses: docker/metadata-action@v3 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}-gui + + - name: Metrics image build & push + uses: docker/build-push-action@v2 + with: + context: . + file: build/sandbox/Dockerfile + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta-gui.outputs.tags }} + labels: ${{ steps.meta-gui.outputs.labels }} \ No newline at end of file diff --git a/Makefile b/Makefile index 7c1d7c710..4590f63bf 100644 --- a/Makefile +++ b/Makefile @@ -175,3 +175,6 @@ gateway-down: gateway-clear: COMPOSE_PROJECT_NAME=bcdhub docker-compose -f docker-compose.gateway.yml down -v + +sandbox-image: + docker build -t ghcr.io/baking-bad/bcdhub-gui:master ./build/sandbox \ No newline at end of file diff --git a/build/graphql/Dockerfile b/build/graphql/Dockerfile deleted file mode 100644 index 399010fae..000000000 --- a/build/graphql/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# --------------------------------------------------------------------- -# The first stage container, for building the application -# --------------------------------------------------------------------- -FROM golang:1.15-alpine as builder - -ENV CGO_ENABLED=0 -ENV GO111MODULE=on -ENV GOOS=linux - -RUN apk --no-cache add ca-certificates -RUN apk add --update git - -RUN mkdir -p $GOPATH/src/github.com/baking-bad/bcdhub/ - -COPY ./go.* $GOPATH/src/github.com/baking-bad/bcdhub/ -WORKDIR $GOPATH/src/github.com/baking-bad/bcdhub -RUN go mod download - -COPY cmd/graphql cmd/graphql -COPY internal internal - -WORKDIR $GOPATH/src/github.com/baking-bad/bcdhub/cmd/graphql/ -RUN go build -a -installsuffix cgo -o /go/bin/graphql . - -# --------------------------------------------------------------------- -# The second stage container, for running the application -# --------------------------------------------------------------------- -FROM scratch - -WORKDIR /app/graphql - -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /go/bin/graphql /go/bin/graphql -COPY cmd/graphql/init.sql . -COPY configs/*.yml /app/graphql/ - -ENTRYPOINT ["/go/bin/graphql"] diff --git a/build/sandbox/Dockerfile b/build/sandbox/Dockerfile new file mode 100644 index 000000000..13a4a0077 --- /dev/null +++ b/build/sandbox/Dockerfile @@ -0,0 +1,14 @@ +FROM node:latest AS build + +RUN git clone https://github.com/baking-bad/bcd.git /bcd + +WORKDIR /bcd +RUN yarn + +COPY .env.production . +RUN yarn build + +FROM nginx:latest AS release +COPY default.conf /etc/nginx/conf.d/default.conf +WORKDIR /usr/share/nginx/html/ +COPY --from=build /bcd/dist ./ \ No newline at end of file diff --git a/build/sandbox/default.conf b/build/sandbox/default.conf new file mode 100644 index 000000000..7fea3a5a0 --- /dev/null +++ b/build/sandbox/default.conf @@ -0,0 +1,10 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html index.htm; + + location / { + try_files $uri /index.html; + } +} \ No newline at end of file diff --git a/build/sandbox/jupyter/Dockerfile b/build/sandbox/jupyter/Dockerfile deleted file mode 100644 index 6b4eefa85..000000000 --- a/build/sandbox/jupyter/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM bakingbad/michelson-kernel - -COPY build/sandbox/jupyter/notebooks /home/jupyter/notebooks - -ENTRYPOINT [ "jupyter", "notebook", "--ip=0.0.0.0", "--no-browser", "--no-mathjax"] - -CMD ["--NotebookApp.allow_origin=*", "--NotebookApp.port=8008", "--NotebookApp.default_url=/tree/notebooks", "--NotebookApp.disable_check_xsrf=True", "--NotebookApp.token="] diff --git a/build/sandbox/jupyter/notebooks/michelson_quickstart.ipynb b/build/sandbox/jupyter/notebooks/michelson_quickstart.ipynb deleted file mode 100644 index c8d56b190..000000000 --- a/build/sandbox/jupyter/notebooks/michelson_quickstart.ipynb +++ /dev/null @@ -1,93 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "parameter unit;\n", - "storage unit;" - ] - } - ], - "source": [ - "parameter unit;\n", - "storage unit;" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "code {\n", - " CDR ;\n", - " NIL operation ;\n", - " PAIR ;\n", - "}" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "RUN: use %default; drop all; push (Unit, Unit);\n", - " CDR: pop (Unit, Unit); push Unit;\n", - " NIL: push [];\n", - " PAIR: pop [], Unit; push ([], Unit);" - ] - }, - { - "data": { - "text/html": [ - "
value | type |
---|---|
Unit | unit |