diff --git a/RetPageOriginDockerfile b/RetPageOriginDockerfile index b652178b67..fd1ef8662d 100644 --- a/RetPageOriginDockerfile +++ b/RetPageOriginDockerfile @@ -2,21 +2,20 @@ # this dockerfile produces image/container that serves customly packaged hubs and admin static files # the result container should serve reticulum as "hubs_page_origin" and "admin_page_origin" on (path) "/hubs/pages" ### -from node:16.13 as builder +from node:16.20 as builder run mkdir -p /hubs/admin/ && cd /hubs copy package.json ./ copy package-lock.json ./ run npm ci copy admin/package.json admin/ copy admin/package-lock.json admin/ -run cd admin && npm ci && cd .. +run cd admin && npm ci --legacy-peer-deps && cd .. copy . . env BASE_ASSETS_PATH="{{rawhubs-base-assets-path}}" run npm run build 1> /dev/null -copy scripts/docker/turkey-swaps/admin-menu.js admin/src/react-components/admin-menu.js run cd admin && npm run build 1> /dev/null && cp -R dist/* ../dist && cd .. run mkdir -p dist/pages && mv dist/*.html dist/pages && mv dist/hub.service.js dist/pages && mv dist/schema.toml dist/pages -run mkdir /hubs/rawhubs && mv dist/pages /hubs/rawhubs && mv dist/assets /hubs/rawhubs && mv dist/react-components /hubs/rawhubs/pages && mv dist/favicon.ico /hubs/rawhubs/pages +run mkdir /hubs/rawhubs && mv dist/pages /hubs/rawhubs && mv dist/assets /hubs/rawhubs && mv dist/favicon.ico /hubs/rawhubs/pages from alpine/openssl as ssl run mkdir /ssl && openssl req -x509 -newkey rsa:2048 -sha256 -days 36500 -nodes -keyout /ssl/key -out /ssl/cert -subj '/CN=hubs' diff --git a/retpack.sh b/retpack.sh new file mode 100644 index 0000000000..027939ac27 --- /dev/null +++ b/retpack.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if ! command -v docker &> /dev/null; then + echo "ERR: this script requires docker (https://docs.docker.com/engine/install/)" + exit 1 +fi + +DOCKER_DEFAULT_PLATFORM=linux/amd64 +echo -e "\n ### building ### " +docker build -f RetPageOriginDockerfile -t hubs:retpack . + +echo -e "\n ### packing ### " +docker run -v $PWD/.retpack/:/tmp/ \ + --entrypoint sh hubs:retpack \ + -c 'cd /www/hubs/ && tar -czvf /tmp/retpack.tar.gz .' + +echo -e "\n ### done ### " +ls -lha ./.retpack/retpack.tar.gz