chore(deploy): add production caddy setup
This commit is contained in:
22
README.md
22
README.md
@@ -14,11 +14,29 @@ Python gRPC OTP authentication service with MongoDB, Redis, RabbitMQ, and select
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
docker compose up --build
|
||||
docker compose -f docker-compose.yml -f docker-compose.local.yml up --build
|
||||
```
|
||||
|
||||
The gRPC service listens on `localhost:50051`. The demo UI is available at `http://localhost:8080`. RabbitMQ management is available at `http://localhost:15672` with `guest` / `guest`.
|
||||
|
||||
## Production Deployment
|
||||
|
||||
Production uses Caddy as the only public entrypoint for `https://gapido.amiirkhl.ir`.
|
||||
|
||||
```bash
|
||||
cp .env.production.example .env.production
|
||||
docker compose --env-file .env.production -f docker-compose.yml -f docker-compose.prod.yml up -d --build
|
||||
```
|
||||
|
||||
Before running production, set real values in `.env.production`:
|
||||
|
||||
- `JWT_SECRET_KEY`
|
||||
- `ADMIN_MOBILE`
|
||||
- `SMS_PROVIDER`
|
||||
- the selected SMS provider credentials
|
||||
|
||||
Only ports `80` and `443` are published in the production Compose overlay. MongoDB, Redis, RabbitMQ, gRPC, and the FastAPI demo service stay private on the Docker network.
|
||||
|
||||
## SMS Provider
|
||||
|
||||
The SMS integration uses the Strategy pattern behind the `SmsClient` port. Select the provider with:
|
||||
@@ -53,6 +71,8 @@ python -m gapido_auth.tools.generate_proto
|
||||
pytest
|
||||
```
|
||||
|
||||
The production Docker image installs runtime dependencies only. Development tools are installed locally through `.[dev]`.
|
||||
|
||||
## gRPC Methods
|
||||
|
||||
- `RequestOtp`: public; creates a short-lived OTP and publishes an SMS job.
|
||||
|
||||
Reference in New Issue
Block a user