# Docker Compose Production-style local stack for Aitori Stylist. ## Run ```bash cd docker cp .env.example .env docker compose up --build ``` Open: - Frontend: http://127.0.0.1:8080/ - API health through Nginx: http://127.0.0.1:8080/api/v1/health If port `8080` is already in use: ```bash FRONTEND_PORT=8081 docker compose up --build ``` Default initial login: - Email: `stylist@example.com` - Password: `Passw0rd!` ## Notes - MySQL and Redis are only exposed inside the compose network. - Backend runs `prisma migrate deploy` before startup. - The initial login account is seeded idempotently after migrations. - Demo seed currently does not insert any data and can be skipped with `SEED_DEMO_DATA=false`. - If Docker Hub is slow or blocked, edit `NODE_IMAGE` and `NGINX_IMAGE` in `.env` to point at your registry mirror. ## Build And Push Images Login to GHCR first: ```bash echo | docker login ghcr.io -u gyj2032-byte --password-stdin ``` Build Linux images and push them to `ghcr.io/gyj2032-byte`: ```bash ./docker_build.sh ./docker_build.sh v1.0.0 ``` Defaults: - Registry: `ghcr.io/gyj2032-byte` - Images: `stylist-backend`, `stylist-frontend` - Platform: `linux/amd64` - Tag: current git short SHA, plus `latest` Override examples: ```bash PLATFORM=linux/arm64 ./docker_build.sh v1.0.0 REGISTRY=ghcr.io/gyj2032-byte IMAGE_PREFIX=stylist ./docker_build.sh ``` ## Production Compose Run the published GHCR images without building from source: ```bash cd docker cp .env.prod.example .env IMAGE_TAG=latest docker compose -f docker-compose.prod.yml pull IMAGE_TAG=latest docker compose -f docker-compose.prod.yml up -d ``` Use a specific pushed tag: ```bash IMAGE_TAG=v1.0.0 docker compose -f docker-compose.prod.yml up -d ``` ## HTTPS Nginx Keep TLS on the host Nginx and proxy to the frontend container port: ```bash sudo cp nginx.conf /etc/nginx/conf.d/stylist.agigo.cloud.conf sudo nginx -t sudo systemctl reload nginx ``` If `FRONTEND_PORT` is not `8080`, update `proxy_pass` in `nginx.https.example.conf` to match it. ## Reset Data ```bash cd docker docker compose down -v docker compose up --build ```