auto deploy on production server now finalized ready for smoke test.
This commit is contained in:
36
README.md
36
README.md
@@ -8,45 +8,21 @@ Local development: see **`backend/README.md`** and **`frontend/README.md`**.
|
||||
|
||||
---
|
||||
|
||||
## Production deploy (Docker Hub + HTTPS + Let's Encrypt)
|
||||
## Production deploy (`https://nudentic.ir`)
|
||||
|
||||
**Full step-by-step guide:** [`infrastructure/DEPLOY.md`](infrastructure/DEPLOY.md)
|
||||
**Full guide:** [`infrastructure/DEPLOY.md`](infrastructure/DEPLOY.md)
|
||||
|
||||
Minimal server setup: install Docker, create `.env` + `secrets/`, `docker login`, run one script.
|
||||
Git tag **`v1.0.1`** → Gitea workflow [`.gitea/workflows/prod-tag-deploy.yml`](.gitea/workflows/prod-tag-deploy.yml) builds images (URLs baked for nudentic.ir), pushes to Gitea registry, SSH-deploys the Linux stack.
|
||||
|
||||
| On server (once) | In repo / Docker |
|
||||
|------------------|------------------|
|
||||
| DNS A record → server IP | `docker-compose.prod.yml`, nginx, certbot |
|
||||
| `docker login` (private Hub) | Build & push images from dev machine |
|
||||
| `secrets/database.env`, `secrets/backend.env` | Examples: `database.prod.env.example`, `backend.prod.env.example` |
|
||||
| `infrastructure/.env` (`DOMAIN`, `LETSENCRYPT_EMAIL`) | `deploy.prod.env.example` |
|
||||
|
||||
**Dev machine** — build frontend with the public domain baked in, push to Docker Hub:
|
||||
|
||||
```bash
|
||||
./infrastructure/scripts/build-and-push-prod.sh wixur.ir latest
|
||||
```
|
||||
|
||||
**Server** — from `infrastructure/`:
|
||||
|
||||
```bash
|
||||
cp deploy.prod.env.example .env # edit DOMAIN, paths
|
||||
mkdir -p ../secrets && cp database.prod.env.example ../secrets/database.env
|
||||
cp backend.prod.env.example ../secrets/backend.env # set passwords + FRONTEND_URL
|
||||
docker login
|
||||
chmod +x scripts/*.sh
|
||||
./scripts/deploy-prod.sh
|
||||
```
|
||||
|
||||
SSL is issued automatically via **Certbot** (`scripts/init-letsencrypt.sh`). Nginx config is generated from `DOMAIN` in `.env`. When you move to another domain (e.g. `dyolink.com`), update `.env` + `backend.env`, re-run `init-letsencrypt.sh`, and **rebuild the frontend image** with the new URL.
|
||||
First-time SSL / Hub fallback: same `DEPLOY.md`.
|
||||
|
||||
---
|
||||
|
||||
## Staging deploy (Gitea Actions + Windows)
|
||||
## Staging deploy (`https://wixur.ir`)
|
||||
|
||||
**Full guide:** [`infrastructure/STAGING-DEPLOY.md`](infrastructure/STAGING-DEPLOY.md)
|
||||
|
||||
Merge or push to **`master`** → Gitea Actions builds images → deploys to `http://wixur.ir` (Gitea: `http://wixur.ir:3000`).
|
||||
Merge or push to **`master`** → Gitea Actions builds images → deploys to `https://wixur.ir` (Gitea: `http://wixur.ir:3000`).
|
||||
|
||||
Workflow: [`.gitea/workflows/registry-build-deploy.yml`](.gitea/workflows/registry-build-deploy.yml)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user