From 044d2b542cd559046121bab3fb432f7700a9edef Mon Sep 17 00:00:00 2001 From: zramsay Date: Mon, 13 Feb 2023 18:31:59 -0500 Subject: [PATCH 1/6] wip --- .../compose/docker-compose-laconic-explorer.yml | 7 +++++++ app/data/config/laconic-explorer/README.md | 1 + .../cerc-laconic-explorer/Dockerfile | 15 +++++++++++++++ .../cerc-laconic-explorer/build.sh | 7 +++++++ app/data/container-image-list.txt | 1 + app/data/pod-list.txt | 1 + app/data/repository-list.txt | 1 + 7 files changed, 33 insertions(+) create mode 100644 app/data/compose/docker-compose-laconic-explorer.yml create mode 100644 app/data/config/laconic-explorer/README.md create mode 100644 app/data/container-build/cerc-laconic-explorer/Dockerfile create mode 100644 app/data/container-build/cerc-laconic-explorer/build.sh diff --git a/app/data/compose/docker-compose-laconic-explorer.yml b/app/data/compose/docker-compose-laconic-explorer.yml new file mode 100644 index 00000000..10319bf1 --- /dev/null +++ b/app/data/compose/docker-compose-laconic-explorer.yml @@ -0,0 +1,7 @@ +version: "3.2" +services: + laconicd: + restart: unless-stopped + image: cerc/laconic-explorer:local + ports: + - "1317" diff --git a/app/data/config/laconic-explorer/README.md b/app/data/config/laconic-explorer/README.md new file mode 100644 index 00000000..af5d642f --- /dev/null +++ b/app/data/config/laconic-explorer/README.md @@ -0,0 +1 @@ +TODO figure out config diff --git a/app/data/container-build/cerc-laconic-explorer/Dockerfile b/app/data/container-build/cerc-laconic-explorer/Dockerfile new file mode 100644 index 00000000..6d3120a3 --- /dev/null +++ b/app/data/container-build/cerc-laconic-explorer/Dockerfile @@ -0,0 +1,15 @@ +# copied and modified from erc20 Dockerfile + +FROM node:16.17.1-alpine3.16 + +RUN apk --update --no-cache add git python3 alpine-sdk + +WORKDIR /app + +COPY . . + +RUN echo "Building Laconic Explorer" && \ + git checkout master && \ + yarn && yarn build + +#WORKDIR /app/packages/erc20-watcher diff --git a/app/data/container-build/cerc-laconic-explorer/build.sh b/app/data/container-build/cerc-laconic-explorer/build.sh new file mode 100644 index 00000000..69d86365 --- /dev/null +++ b/app/data/container-build/cerc-laconic-explorer/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Build cerc/laconic-explorer + +# See: https://stackoverflow.com/a/246128/1701505 +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +docker build -t cerc/laconic-explorer:local -f ${SCRIPT_DIR}/Dockerfile ${CERC_REPO_BASE_DIR}/laconic-explorer diff --git a/app/data/container-image-list.txt b/app/data/container-image-list.txt index f22b4543..9878d4aa 100644 --- a/app/data/container-image-list.txt +++ b/app/data/container-image-list.txt @@ -24,3 +24,4 @@ cerc/builder-js cerc/keycloak cerc/tx-spammer cerc/builder-gerbil +cerc/laconic-explorer diff --git a/app/data/pod-list.txt b/app/data/pod-list.txt index 81ec9e99..79ca47a0 100644 --- a/app/data/pod-list.txt +++ b/app/data/pod-list.txt @@ -19,3 +19,4 @@ eth-probe keycloak tx-spammer kubo +laconic-explorer diff --git a/app/data/repository-list.txt b/app/data/repository-list.txt index 35f47c07..4d664236 100644 --- a/app/data/repository-list.txt +++ b/app/data/repository-list.txt @@ -17,3 +17,4 @@ vulcanize/assemblyscript cerc-io/eth-probe cerc-io/tx-spammer foundry-rs/foundry +gateway-fm/laconic-explorer -- 2.45.2 From 5edbf27ac2e8804a186a1b482c6568b2fa9c0788 Mon Sep 17 00:00:00 2001 From: zramsay Date: Mon, 13 Feb 2023 18:50:52 -0500 Subject: [PATCH 2/6] add ping.conf --- app/data/config/laconic-explorer/default.conf | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 app/data/config/laconic-explorer/default.conf diff --git a/app/data/config/laconic-explorer/default.conf b/app/data/config/laconic-explorer/default.conf new file mode 100644 index 00000000..5d2430c0 --- /dev/null +++ b/app/data/config/laconic-explorer/default.conf @@ -0,0 +1,33 @@ +## copied from: https://github.com/gateway-fm/laconic-explorer/blob/master/ping.conf +server { + listen 80; + listen [::]:80; + server_name _; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + gzip on; + gzip_proxied any; + gzip_static on; + gzip_min_length 1024; + gzip_buffers 4 16k; + gzip_comp_level 2; + gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml; + gzip_vary off; + gzip_disable "MSIE [1-6]\."; +} -- 2.45.2 From abe050f00c522474b718cd078df5c26c7b646bec Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 14 Feb 2023 13:38:33 -0500 Subject: [PATCH 3/6] ... --- app/data/container-build/cerc-laconic-explorer/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/data/container-build/cerc-laconic-explorer/Dockerfile b/app/data/container-build/cerc-laconic-explorer/Dockerfile index 6d3120a3..d3b9bec0 100644 --- a/app/data/container-build/cerc-laconic-explorer/Dockerfile +++ b/app/data/container-build/cerc-laconic-explorer/Dockerfile @@ -10,6 +10,4 @@ COPY . . RUN echo "Building Laconic Explorer" && \ git checkout master && \ - yarn && yarn build - -#WORKDIR /app/packages/erc20-watcher + yarn && yarn serve -- 2.45.2 From a0f11c9d0de8783242d3a861a5173a0da9b8becf Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 14 Feb 2023 13:53:44 -0500 Subject: [PATCH 4/6] re-org config file, copy onbuild instead of volumes FTTB --- .../{laconic-explorer => nginx}/default.conf | 0 .../cerc-laconic-explorer/Dockerfile | 4 ++- .../container-build/cerc-nginx/Dockerfile | 2 ++ app/data/container-build/cerc-nginx/build.sh | 7 ++++ app/data/container-build/cerc-nginx/ping.conf | 33 +++++++++++++++++++ app/data/container-image-list.txt | 1 + 6 files changed, 46 insertions(+), 1 deletion(-) rename app/data/config/{laconic-explorer => nginx}/default.conf (100%) create mode 100644 app/data/container-build/cerc-nginx/Dockerfile create mode 100644 app/data/container-build/cerc-nginx/build.sh create mode 100644 app/data/container-build/cerc-nginx/ping.conf diff --git a/app/data/config/laconic-explorer/default.conf b/app/data/config/nginx/default.conf similarity index 100% rename from app/data/config/laconic-explorer/default.conf rename to app/data/config/nginx/default.conf diff --git a/app/data/container-build/cerc-laconic-explorer/Dockerfile b/app/data/container-build/cerc-laconic-explorer/Dockerfile index d3b9bec0..b66b75a2 100644 --- a/app/data/container-build/cerc-laconic-explorer/Dockerfile +++ b/app/data/container-build/cerc-laconic-explorer/Dockerfile @@ -10,4 +10,6 @@ COPY . . RUN echo "Building Laconic Explorer" && \ git checkout master && \ - yarn && yarn serve + yarn + +CMD ["yarn serve"] diff --git a/app/data/container-build/cerc-nginx/Dockerfile b/app/data/container-build/cerc-nginx/Dockerfile new file mode 100644 index 00000000..eef81d08 --- /dev/null +++ b/app/data/container-build/cerc-nginx/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:alpine +COPY ping.conf /etc/nginx/conf.d/default.conf diff --git a/app/data/container-build/cerc-nginx/build.sh b/app/data/container-build/cerc-nginx/build.sh new file mode 100644 index 00000000..6476a8f6 --- /dev/null +++ b/app/data/container-build/cerc-nginx/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Build cerc/nginx + +# See: https://stackoverflow.com/a/246128/1701505 +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +docker build -t cerc/nginx:local ${SCRIPT_DIR} diff --git a/app/data/container-build/cerc-nginx/ping.conf b/app/data/container-build/cerc-nginx/ping.conf new file mode 100644 index 00000000..5d2430c0 --- /dev/null +++ b/app/data/container-build/cerc-nginx/ping.conf @@ -0,0 +1,33 @@ +## copied from: https://github.com/gateway-fm/laconic-explorer/blob/master/ping.conf +server { + listen 80; + listen [::]:80; + server_name _; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + gzip on; + gzip_proxied any; + gzip_static on; + gzip_min_length 1024; + gzip_buffers 4 16k; + gzip_comp_level 2; + gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml; + gzip_vary off; + gzip_disable "MSIE [1-6]\."; +} diff --git a/app/data/container-image-list.txt b/app/data/container-image-list.txt index 9878d4aa..f22bf044 100644 --- a/app/data/container-image-list.txt +++ b/app/data/container-image-list.txt @@ -25,3 +25,4 @@ cerc/keycloak cerc/tx-spammer cerc/builder-gerbil cerc/laconic-explorer +cerc/nginx -- 2.45.2 From b31a70cd3afceb5fb0c658934a39a207681e151a Mon Sep 17 00:00:00 2001 From: zramsay Date: Fri, 24 Feb 2023 09:59:14 -0500 Subject: [PATCH 5/6] compose works but not integrated with Laconicd --- .../docker-compose-laconic-explorer-test.yml | 13 +++++++++++ .../docker-compose-laconic-explorer.yml | 23 +++++++++++++++---- .../{nginx => laconic-explorer}/default.conf | 0 .../cerc-laconic-explorer/Dockerfile | 6 +++-- .../cerc-laconic-explorer/build.sh | 0 app/data/container-build/cerc-nginx/build.sh | 0 6 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 app/data/compose/docker-compose-laconic-explorer-test.yml rename app/data/config/{nginx => laconic-explorer}/default.conf (100%) mode change 100644 => 100755 app/data/container-build/cerc-laconic-explorer/build.sh mode change 100644 => 100755 app/data/container-build/cerc-nginx/build.sh diff --git a/app/data/compose/docker-compose-laconic-explorer-test.yml b/app/data/compose/docker-compose-laconic-explorer-test.yml new file mode 100644 index 00000000..b5fcce4e --- /dev/null +++ b/app/data/compose/docker-compose-laconic-explorer-test.yml @@ -0,0 +1,13 @@ +version: '3.8' + +services: + laconic-explorer: + image: cerc/laconic-explorer:local + #env_file: + #- ../config/laconic-explorer/TODO? + #volumes: + #- ../config/keycloak/import:/import + ports: + - "8080:8080" + # command: ["yarn serve"] + stdin_open: true diff --git a/app/data/compose/docker-compose-laconic-explorer.yml b/app/data/compose/docker-compose-laconic-explorer.yml index 10319bf1..ad56eea6 100644 --- a/app/data/compose/docker-compose-laconic-explorer.yml +++ b/app/data/compose/docker-compose-laconic-explorer.yml @@ -1,7 +1,22 @@ -version: "3.2" +version: '3.8' + services: - laconicd: - restart: unless-stopped + laconic-explorer: image: cerc/laconic-explorer:local + #env_file: + #- ../config/laconic-explorer/TODO? + #volumes: + #- ../config/keycloak/import:/import ports: - - "1317" + - "8080:8080" + command: ["yarn serve"] + depends_on: + explorer-nginx: + condition: service_healthy + explorer-nginx: + image: nginx:1.23-alpine + restart: always + volumes: + - ../config/laconic-explorer/default.conf:/etc/nginx/conf.d/default.conf + ports: + - "80:80" diff --git a/app/data/config/nginx/default.conf b/app/data/config/laconic-explorer/default.conf similarity index 100% rename from app/data/config/nginx/default.conf rename to app/data/config/laconic-explorer/default.conf diff --git a/app/data/container-build/cerc-laconic-explorer/Dockerfile b/app/data/container-build/cerc-laconic-explorer/Dockerfile index b66b75a2..2f84a73d 100644 --- a/app/data/container-build/cerc-laconic-explorer/Dockerfile +++ b/app/data/container-build/cerc-laconic-explorer/Dockerfile @@ -4,7 +4,7 @@ FROM node:16.17.1-alpine3.16 RUN apk --update --no-cache add git python3 alpine-sdk -WORKDIR /app +WORKDIR / COPY . . @@ -12,4 +12,6 @@ RUN echo "Building Laconic Explorer" && \ git checkout master && \ yarn -CMD ["yarn serve"] +EXPOSE 8080 + +CMD ["yarn", "serve"] diff --git a/app/data/container-build/cerc-laconic-explorer/build.sh b/app/data/container-build/cerc-laconic-explorer/build.sh old mode 100644 new mode 100755 diff --git a/app/data/container-build/cerc-nginx/build.sh b/app/data/container-build/cerc-nginx/build.sh old mode 100644 new mode 100755 -- 2.45.2 From 91ed4fbb956c36a618cc31ea43b34a1900b18c6b Mon Sep 17 00:00:00 2001 From: zramsay Date: Tue, 7 Mar 2023 08:52:47 -0500 Subject: [PATCH 6/6] cleanup --- app/data/config/laconic-explorer/README.md | 1 - .../container-build/cerc-nginx/Dockerfile | 2 -- app/data/container-build/cerc-nginx/build.sh | 7 ---- app/data/container-build/cerc-nginx/ping.conf | 33 ------------------- app/data/container-image-list.txt | 1 - 5 files changed, 44 deletions(-) delete mode 100644 app/data/config/laconic-explorer/README.md delete mode 100644 app/data/container-build/cerc-nginx/Dockerfile delete mode 100755 app/data/container-build/cerc-nginx/build.sh delete mode 100644 app/data/container-build/cerc-nginx/ping.conf diff --git a/app/data/config/laconic-explorer/README.md b/app/data/config/laconic-explorer/README.md deleted file mode 100644 index af5d642f..00000000 --- a/app/data/config/laconic-explorer/README.md +++ /dev/null @@ -1 +0,0 @@ -TODO figure out config diff --git a/app/data/container-build/cerc-nginx/Dockerfile b/app/data/container-build/cerc-nginx/Dockerfile deleted file mode 100644 index eef81d08..00000000 --- a/app/data/container-build/cerc-nginx/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM nginx:alpine -COPY ping.conf /etc/nginx/conf.d/default.conf diff --git a/app/data/container-build/cerc-nginx/build.sh b/app/data/container-build/cerc-nginx/build.sh deleted file mode 100755 index 6476a8f6..00000000 --- a/app/data/container-build/cerc-nginx/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -# Build cerc/nginx - -# See: https://stackoverflow.com/a/246128/1701505 -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -docker build -t cerc/nginx:local ${SCRIPT_DIR} diff --git a/app/data/container-build/cerc-nginx/ping.conf b/app/data/container-build/cerc-nginx/ping.conf deleted file mode 100644 index 5d2430c0..00000000 --- a/app/data/container-build/cerc-nginx/ping.conf +++ /dev/null @@ -1,33 +0,0 @@ -## copied from: https://github.com/gateway-fm/laconic-explorer/blob/master/ping.conf -server { - listen 80; - listen [::]:80; - server_name _; - - #access_log /var/log/nginx/host.access.log main; - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } - - #error_page 404 /404.html; - - # redirect server error pages to the static page /50x.html - # - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - - gzip on; - gzip_proxied any; - gzip_static on; - gzip_min_length 1024; - gzip_buffers 4 16k; - gzip_comp_level 2; - gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml; - gzip_vary off; - gzip_disable "MSIE [1-6]\."; -} diff --git a/app/data/container-image-list.txt b/app/data/container-image-list.txt index f22bf044..9878d4aa 100644 --- a/app/data/container-image-list.txt +++ b/app/data/container-image-list.txt @@ -25,4 +25,3 @@ cerc/keycloak cerc/tx-spammer cerc/builder-gerbil cerc/laconic-explorer -cerc/nginx -- 2.45.2