1.6 KiB
1.6 KiB
ProgCode.Ru
Structure:
web/— Next.js application.web/data/articles.json— article data used by the site.web/public/assets/illustrations/— SVG illustrations and article covers.web/public/assets/media/— raster images used by the site.web/scripts/buildDatabase.mjs— refreshes article data and generated assets from local source files.
Useful commands:
cd ~/tmp/progcode/web
npm install
node scripts/buildDatabase.mjs
npm run dev -- --port 3000
npm run build
Docker static deploy:
docker build -t progcode:static .
docker run --rm -p 8080:8080 progcode:static
Swarm example:
DOMAIN=progcode.example.com IMAGE=registry.example.com/progcode:static \
docker stack deploy -c deploy/stack.example.yml progcode
Gitea Actions variables:
DOMAIN— public host routed by Traefik.IMAGE— full image tag to build and deploy, for exampleregistry.example.com/progcode:latest.IMAGE_REPO— optional alternative toIMAGE; the workflow will tag images as${IMAGE_REPO}:${short_sha}.REGISTRY— registry host fordocker login.STACK_NAME— optional, defaults toprogcode.TRAEFIK_NETWORK— optional, defaults totraefik-public.TRAEFIK_ENTRYPOINT— optional, defaults towebsecure.PUSH_LATEST— optional, set totrueto also push${IMAGE_REPO}:latest.
Gitea Actions secrets:
REGISTRY_USERREGISTRY_PASSWORDDEPLOY_SSH_KEY— only when deploying to a remote Swarm manager over SSH.
Remote Swarm deploy variables:
DEPLOY_HOSTDEPLOY_USERDEPLOY_PORT— optional, defaults to22.