Expand Gorush setup instructions in Dokku guide
Add step-by-step instructions for: - Creating certificate storage directory - Copying APNs key to server - Mounting certificates to container - Setting GORUSH_IOS_KEY_PATH environment variable - Configuring proxy ports - Verification steps 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -90,7 +90,7 @@ sudo DOKKU_TAG=v0.34.4 bash bootstrap.sh
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Set your domain (replace with your actual domain)
|
# Set your domain (replace with your actual domain)
|
||||||
dokku domains:set-global casera.yourdomain.com
|
dokku domains:set-global casera.treytartt.com
|
||||||
|
|
||||||
# Add your SSH public key for deployments
|
# Add your SSH public key for deployments
|
||||||
# Run this from your LOCAL machine:
|
# Run this from your LOCAL machine:
|
||||||
@@ -123,7 +123,7 @@ dokku apps:create casera-api
|
|||||||
### 2. Set the Domain
|
### 2. Set the Domain
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dokku domains:add casera-api api.casera.yourdomain.com
|
dokku domains:add casera-api api.casera.treytartt.com
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Configure Buildpack (if needed)
|
### 3. Configure Buildpack (if needed)
|
||||||
@@ -173,7 +173,7 @@ dokku config:set casera-api \
|
|||||||
DB_PORT=5432 \
|
DB_PORT=5432 \
|
||||||
POSTGRES_DB=casera_db \
|
POSTGRES_DB=casera_db \
|
||||||
POSTGRES_USER=postgres \
|
POSTGRES_USER=postgres \
|
||||||
POSTGRES_PASSWORD=<password-from-info>
|
POSTGRES_PASSWORD=1mJPfu6rzG9r6xukcGbUOU5NoCg0jKfa
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -206,20 +206,20 @@ dokku redis:info casera-redis
|
|||||||
dokku config:set casera-api \
|
dokku config:set casera-api \
|
||||||
PORT=5000 \
|
PORT=5000 \
|
||||||
DEBUG=false \
|
DEBUG=false \
|
||||||
ALLOWED_HOSTS=api.casera.yourdomain.com,localhost \
|
ALLOWED_HOSTS=api.casera.treytartt.com,localhost \
|
||||||
TIMEZONE=UTC \
|
TIMEZONE=UTC \
|
||||||
SECRET_KEY=$(openssl rand -hex 32)
|
SECRET_KEY=8553813eda361017a02677ed504abdd331537cfe6f7cc407345f037cc22c75fc
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Email Configuration
|
### 2. Email Configuration
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dokku config:set casera-api \
|
dokku config:set casera-api \
|
||||||
EMAIL_HOST=smtp.gmail.com \
|
EMAIL_HOST=smtp.fastmail.com \
|
||||||
EMAIL_PORT=587 \
|
EMAIL_PORT=587 \
|
||||||
EMAIL_USE_TLS=true \
|
EMAIL_USE_TLS=true \
|
||||||
EMAIL_HOST_USER=your-email@gmail.com \
|
EMAIL_HOST_USER=treytartt@fastmail.com \
|
||||||
EMAIL_HOST_PASSWORD=your-app-password \
|
EMAIL_HOST_PASSWORD=2t9y4n4t497z5863 \
|
||||||
DEFAULT_FROM_EMAIL="Casera <noreply@casera.com>"
|
DEFAULT_FROM_EMAIL="Casera <noreply@casera.com>"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -227,8 +227,8 @@ dokku config:set casera-api \
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
dokku config:set casera-api \
|
dokku config:set casera-api \
|
||||||
APPLE_CLIENT_ID=com.yourcompany.casera \
|
APPLE_CLIENT_ID=com.tt.casera.CaseraDev \
|
||||||
APPLE_TEAM_ID=XXXXXXXXXX
|
APPLE_TEAM_ID=V3PF3M6B6U
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Push Notifications (Optional)
|
### 4. Push Notifications (Optional)
|
||||||
@@ -236,9 +236,9 @@ dokku config:set casera-api \
|
|||||||
```bash
|
```bash
|
||||||
dokku config:set casera-api \
|
dokku config:set casera-api \
|
||||||
GORUSH_URL=http://localhost:8088 \
|
GORUSH_URL=http://localhost:8088 \
|
||||||
APNS_AUTH_KEY_ID=XXXXXXXXXX \
|
APNS_AUTH_KEY_ID=R9N3SM2WD5 \
|
||||||
APNS_TEAM_ID=XXXXXXXXXX \
|
APNS_TEAM_ID=XXXXXXXXXX \
|
||||||
APNS_TOPIC=com.yourcompany.casera \
|
APNS_TOPIC=com.tt.casera.CaseraDev \
|
||||||
APNS_USE_SANDBOX=false \
|
APNS_USE_SANDBOX=false \
|
||||||
FCM_SERVER_KEY=your-firebase-server-key
|
FCM_SERVER_KEY=your-firebase-server-key
|
||||||
```
|
```
|
||||||
@@ -247,7 +247,7 @@ dokku config:set casera-api \
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
dokku config:set casera-api \
|
dokku config:set casera-api \
|
||||||
NEXT_PUBLIC_API_URL=https://api.casera.yourdomain.com
|
NEXT_PUBLIC_API_URL=https://api.casera.treytartt.com
|
||||||
```
|
```
|
||||||
|
|
||||||
### 6. View All Configuration
|
### 6. View All Configuration
|
||||||
@@ -325,7 +325,7 @@ dokku logs casera-api -t
|
|||||||
dokku ps:report casera-api
|
dokku ps:report casera-api
|
||||||
|
|
||||||
# Check app is running
|
# Check app is running
|
||||||
curl https://api.casera.yourdomain.com/api/health/
|
curl https://api.casera.treytartt.com/api/health/
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -335,7 +335,7 @@ curl https://api.casera.yourdomain.com/api/health/
|
|||||||
### 1. Set Let's Encrypt Email
|
### 1. Set Let's Encrypt Email
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dokku letsencrypt:set casera-api email admin@yourdomain.com
|
dokku letsencrypt:set casera-api email admin@treytartt.com
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Enable Let's Encrypt
|
### 2. Enable Let's Encrypt
|
||||||
@@ -382,30 +382,88 @@ dokku ps:report casera-api
|
|||||||
|
|
||||||
### Option A: Run Gorush as Separate Dokku App
|
### Option A: Run Gorush as Separate Dokku App
|
||||||
|
|
||||||
|
#### 1. Create Gorush App
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Create Gorush app
|
|
||||||
dokku apps:create gorush
|
dokku apps:create gorush
|
||||||
|
```
|
||||||
|
|
||||||
# Deploy Gorush (using Docker image)
|
#### 2. Create Certificate Storage Directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Create directory on server
|
||||||
|
mkdir -p /var/lib/dokku/data/storage/gorush/certs
|
||||||
|
|
||||||
|
# Set permissions (Dokku container user)
|
||||||
|
chown -R 32767:32767 /var/lib/dokku/data/storage/gorush
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 3. Copy APNs Key to Server
|
||||||
|
|
||||||
|
From your **local machine**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scp /path/to/AuthKey_XXXXXX.p8 root@your-server:/var/lib/dokku/data/storage/gorush/certs/apns_key.p8
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 4. Mount Certificate Directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dokku storage:mount gorush /var/lib/dokku/data/storage/gorush/certs:/certs:ro
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 5. Deploy Gorush
|
||||||
|
|
||||||
|
```bash
|
||||||
dokku git:from-image gorush appleboy/gorush:latest
|
dokku git:from-image gorush appleboy/gorush:latest
|
||||||
|
```
|
||||||
|
|
||||||
# Set environment
|
#### 6. Configure Gorush Environment
|
||||||
|
|
||||||
|
```bash
|
||||||
dokku config:set gorush \
|
dokku config:set gorush \
|
||||||
GORUSH_CORE_PORT=8080 \
|
GORUSH_CORE_PORT=8080 \
|
||||||
GORUSH_IOS_ENABLED=true \
|
GORUSH_IOS_ENABLED=true \
|
||||||
|
GORUSH_IOS_KEY_PATH=/certs/apns_key.p8 \
|
||||||
GORUSH_IOS_KEY_ID=XXXXXXXXXX \
|
GORUSH_IOS_KEY_ID=XXXXXXXXXX \
|
||||||
GORUSH_IOS_TEAM_ID=XXXXXXXXXX \
|
GORUSH_IOS_TEAM_ID=XXXXXXXXXX \
|
||||||
GORUSH_IOS_TOPIC=com.yourcompany.casera \
|
GORUSH_IOS_TOPIC=com.yourcompany.casera \
|
||||||
GORUSH_IOS_PRODUCTION=true
|
GORUSH_IOS_PRODUCTION=true \
|
||||||
|
GORUSH_ANDROID_ENABLED=true \
|
||||||
|
GORUSH_ANDROID_APIKEY=your-firebase-server-key
|
||||||
|
```
|
||||||
|
|
||||||
# Mount certificates
|
#### 7. Set Proxy Port
|
||||||
dokku storage:mount gorush /var/lib/dokku/data/storage/casera-api/certs:/certs:ro
|
|
||||||
dokku config:set gorush GORUSH_IOS_KEY_PATH=/certs/apns_key.p8
|
|
||||||
|
|
||||||
# Update Casera API to point to Gorush
|
```bash
|
||||||
|
dokku proxy:ports-set gorush http:80:8080
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 8. Restart Gorush
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dokku ps:restart gorush
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 9. Configure Casera API to Use Gorush
|
||||||
|
|
||||||
|
```bash
|
||||||
dokku config:set casera-api GORUSH_URL=http://gorush.web:8080
|
dokku config:set casera-api GORUSH_URL=http://gorush.web:8080
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### 10. Verify Gorush is Running
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Check status
|
||||||
|
dokku ps:report gorush
|
||||||
|
|
||||||
|
# Check logs
|
||||||
|
dokku logs gorush
|
||||||
|
|
||||||
|
# Test health endpoint (if you have a domain set)
|
||||||
|
curl http://gorush.yourdomain.com/api/stat/go
|
||||||
|
```
|
||||||
|
|
||||||
### Option B: Use External Push Service
|
### Option B: Use External Push Service
|
||||||
|
|
||||||
Configure the app to use an external push notification service instead.
|
Configure the app to use an external push notification service instead.
|
||||||
|
|||||||
Reference in New Issue
Block a user