Files
progcode/README.md
T
huncode fc603f9579
Build and deploy / deploy (push) Has been cancelled
Добавить статичный Docker-деплой
2026-05-17 22:35:08 +03:00

58 lines
1.6 KiB
Markdown

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:
```bash
cd ~/tmp/progcode/web
npm install
node scripts/buildDatabase.mjs
npm run dev -- --port 3000
npm run build
```
Docker static deploy:
```bash
docker build -t progcode:static .
docker run --rm -p 8080:8080 progcode:static
```
Swarm example:
```bash
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 example `registry.example.com/progcode:latest`.
- `IMAGE_REPO` — optional alternative to `IMAGE`; the workflow will tag images as `${IMAGE_REPO}:${short_sha}`.
- `REGISTRY` — registry host for `docker login`.
- `STACK_NAME` — optional, defaults to `progcode`.
- `TRAEFIK_NETWORK` — optional, defaults to `traefik-public`.
- `TRAEFIK_ENTRYPOINT` — optional, defaults to `websecure`.
- `PUSH_LATEST` — optional, set to `true` to also push `${IMAGE_REPO}:latest`.
Gitea Actions secrets:
- `REGISTRY_USER`
- `REGISTRY_PASSWORD`
- `DEPLOY_SSH_KEY` — only when deploying to a remote Swarm manager over SSH.
Remote Swarm deploy variables:
- `DEPLOY_HOST`
- `DEPLOY_USER`
- `DEPLOY_PORT` — optional, defaults to `22`.