1.1 changes
This commit is contained in:
@@ -13,7 +13,7 @@ Separate from `ctrl/` which contains **local** orchestration scripts.
|
||||
server/
|
||||
├── setup.sh # Idempotent server setup (run on AWS)
|
||||
├── nginx/
|
||||
│ └── core_nest.conf # Single nginx config for all services
|
||||
│ └── core_room.conf # Single nginx config for all services
|
||||
└── scripts/ # Any other server-side scripts
|
||||
```
|
||||
|
||||
@@ -22,7 +22,7 @@ server/
|
||||
When deployed, the AWS instance should look like:
|
||||
|
||||
```
|
||||
~/core_nest/ # This repo (deployed via deploy.sh)
|
||||
~/core_room/ # This repo (deployed via deploy.sh)
|
||||
├── server/ # Server-side scripts
|
||||
│ ├── setup.sh # Run this first
|
||||
│ └── nginx/
|
||||
@@ -37,7 +37,7 @@ When deployed, the AWS instance should look like:
|
||||
│ └── src/ # Synced from local via manual_sync/
|
||||
│ ├── back/ # Django source
|
||||
│ └── front/ # Next.js source
|
||||
└── pawprint/
|
||||
└── soleprint/
|
||||
├── docker-compose.yml
|
||||
├── .env # Production values
|
||||
└── (bare metal or src/ depending on deployment)
|
||||
@@ -49,14 +49,14 @@ When deployed, the AWS instance should look like:
|
||||
|
||||
```bash
|
||||
# 1. From local machine: Deploy files
|
||||
cd ~/wdir/ama/core_nest/ctrl
|
||||
cd ~/wdir/ama/core_room/ctrl
|
||||
./deploy.sh
|
||||
|
||||
# 2. SSH to server
|
||||
ssh mariano@mcrn.ar
|
||||
|
||||
# 3. Run server setup (idempotent - safe to re-run)
|
||||
cd ~/core_nest/server
|
||||
cd ~/core_room/server
|
||||
./setup.sh
|
||||
```
|
||||
|
||||
@@ -70,19 +70,19 @@ This will:
|
||||
### Updates/Changes
|
||||
|
||||
```bash
|
||||
# From local: edit server/nginx/core_nest.conf or server/setup.sh
|
||||
# From local: edit server/nginx/core_room.conf or server/setup.sh
|
||||
# Then deploy:
|
||||
./deploy.sh
|
||||
|
||||
# On server: re-run setup to apply changes
|
||||
ssh mariano@mcrn.ar 'cd ~/core_nest/server && ./setup.sh'
|
||||
ssh mariano@mcrn.ar 'cd ~/core_room/server && ./setup.sh'
|
||||
```
|
||||
|
||||
### Build and Start Services
|
||||
|
||||
```bash
|
||||
# On server (or via SSH):
|
||||
cd ~/core_nest/ctrl
|
||||
cd ~/core_room/ctrl
|
||||
./build.sh # Build all images
|
||||
./start.sh -d # Start detached
|
||||
./status.sh # Check status
|
||||
@@ -100,11 +100,11 @@ Idempotent setup script that runs on AWS:
|
||||
|
||||
**Safe to run multiple times** - won't break existing setup.
|
||||
|
||||
### server/nginx/core_nest.conf
|
||||
### server/nginx/core_room.conf
|
||||
|
||||
Single nginx config file for all services:
|
||||
- amar.nest.mcrn.ar (frontend + backend)
|
||||
- pawprint.mcrn.ar
|
||||
- amar.room.mcrn.ar (frontend + backend)
|
||||
- soleprint.mcrn.ar
|
||||
- artery.mcrn.ar
|
||||
- album.mcrn.ar
|
||||
- ward.mcrn.ar
|
||||
@@ -117,8 +117,8 @@ Create production `.env` files:
|
||||
|
||||
```bash
|
||||
# On server:
|
||||
nano ~/core_nest/amar/.env # Set INIT_DB_SEED=test or prod
|
||||
nano ~/core_nest/pawprint/.env # Set NEST_NAME, ports, etc.
|
||||
nano ~/core_room/amar/.env # Set INIT_DB_SEED=test or prod
|
||||
nano ~/core_room/soleprint/.env # Set ROOM_NAME, ports, etc.
|
||||
```
|
||||
|
||||
## SSL Certificates
|
||||
@@ -126,10 +126,10 @@ nano ~/core_nest/pawprint/.env # Set NEST_NAME, ports, etc.
|
||||
Certificates are managed via Let's Encrypt:
|
||||
|
||||
```bash
|
||||
# Wildcard for *.nest.mcrn.ar (for amar)
|
||||
sudo certbot certonly --manual --preferred-challenges dns -d '*.nest.mcrn.ar'
|
||||
# Wildcard for *.room.mcrn.ar (for amar)
|
||||
sudo certbot certonly --manual --preferred-challenges dns -d '*.room.mcrn.ar'
|
||||
|
||||
# Wildcard for *.mcrn.ar (for pawprint services)
|
||||
# Wildcard for *.mcrn.ar (for soleprint services)
|
||||
sudo certbot certonly --manual --preferred-challenges dns -d '*.mcrn.ar'
|
||||
```
|
||||
|
||||
@@ -140,12 +140,12 @@ Auto-renewal is handled by certbot systemd timer.
|
||||
### Nginx config test fails
|
||||
```bash
|
||||
sudo nginx -t
|
||||
# Fix errors in server/nginx/core_nest.conf
|
||||
# Fix errors in server/nginx/core_room.conf
|
||||
```
|
||||
|
||||
### Services won't start
|
||||
```bash
|
||||
cd ~/core_nest/ctrl
|
||||
cd ~/core_room/ctrl
|
||||
./logs.sh # Check all logs
|
||||
./logs.sh amar # Check specific service
|
||||
docker ps -a # See all containers
|
||||
@@ -154,10 +154,10 @@ docker ps -a # See all containers
|
||||
### Database issues
|
||||
```bash
|
||||
# Check which seed data is configured
|
||||
grep INIT_DB_SEED ~/core_nest/amar/.env
|
||||
grep INIT_DB_SEED ~/core_room/amar/.env
|
||||
|
||||
# Rebuild database (WARNING: deletes data)
|
||||
cd ~/core_nest
|
||||
cd ~/core_room
|
||||
docker compose -f amar/docker-compose.yml down -v
|
||||
./ctrl/start.sh amar -d
|
||||
```
|
||||
@@ -172,14 +172,14 @@ This allows ward/tester to access tests from amar_django_back_contracts without
|
||||
|
||||
```bash
|
||||
# Preview changes
|
||||
ssh mariano@mcrn.ar 'cd ~/core_nest/ctrl/server && ./setup-symlinks.sh --dry-run'
|
||||
ssh mariano@mcrn.ar 'cd ~/core_room/ctrl/server && ./setup-symlinks.sh --dry-run'
|
||||
|
||||
# Apply changes
|
||||
ssh mariano@mcrn.ar 'cd ~/core_nest/ctrl/server && ./setup-symlinks.sh'
|
||||
ssh mariano@mcrn.ar 'cd ~/core_room/ctrl/server && ./setup-symlinks.sh'
|
||||
```
|
||||
|
||||
**What it does:**
|
||||
- Creates symlinks from `pawprint/src/ward/tools/tester/tests/` to `amar/src/back/tests/contracts/`
|
||||
- Creates symlinks from `soleprint/src/ward/tools/tester/tests/` to `amar/src/back/tests/contracts/`
|
||||
- Symlinks each domain directory (mascotas, productos, solicitudes, workflows)
|
||||
- Symlinks shared utilities (endpoints.py, helpers.py, base.py, conftest.py)
|
||||
|
||||
@@ -214,10 +214,10 @@ After setup, verify symlinks are working:
|
||||
|
||||
```bash
|
||||
# Check symlinks exist
|
||||
ssh mariano@mcrn.ar 'ls -lah ~/core_nest/pawprint/src/ward/tools/tester/tests'
|
||||
ssh mariano@mcrn.ar 'ls -lah ~/core_room/soleprint/src/ward/tools/tester/tests'
|
||||
|
||||
# Verify they point to correct location
|
||||
ssh mariano@mcrn.ar 'readlink ~/core_nest/pawprint/src/ward/tools/tester/tests/mascotas'
|
||||
ssh mariano@mcrn.ar 'readlink ~/core_room/soleprint/src/ward/tools/tester/tests/mascotas'
|
||||
|
||||
# Test in browser
|
||||
open https://ward.mcrn.ar/tools/tester/
|
||||
@@ -230,5 +230,5 @@ open https://ward.mcrn.ar/tools/tester/
|
||||
- Database volumes persist in Docker volumes
|
||||
- Backup database regularly:
|
||||
```bash
|
||||
docker exec core_nest_db pg_dump -U postgres amarback > backup.sql
|
||||
docker exec core_room_db pg_dump -U postgres amarback > backup.sql
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user