* Add self host setup * Improve blunders * Move to bull mq * More changes * Add example code for sending test emails
60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
name: unsend-prod
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
container_name: unsend-db-prod
|
|
restart: always
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER:?err}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err}
|
|
- POSTGRES_DB=${POSTGRES_DB:?err}
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
# ports:
|
|
# - "5432:5432"
|
|
volumes:
|
|
- database:/var/lib/postgresql/data
|
|
|
|
redis:
|
|
image: redis:7
|
|
container_name: unsend-redis-prod
|
|
restart: always
|
|
# ports:
|
|
# - "6379:6379"
|
|
volumes:
|
|
- cache:/data
|
|
command: ["redis-server", "--maxmemory-policy", "noeviction"]
|
|
|
|
unsend:
|
|
image: unsend/unsend:latest
|
|
container_name: unsend
|
|
restart: always
|
|
ports:
|
|
- ${PORT:-3000}:${PORT:-3000}
|
|
environment:
|
|
- PORT=${PORT:-3000}
|
|
- DATABASE_URL=${DATABASE_URL:?err}
|
|
- NEXTAUTH_URL=${NEXTAUTH_URL:?err}
|
|
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:?err}
|
|
- AWS_ACCESS_KEY=${AWS_ACCESS_KEY:?err}
|
|
- AWS_SECRET_KEY=${AWS_SECRET_KEY:?err}
|
|
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:?err}
|
|
- GITHUB_ID=${GITHUB_ID:?err}
|
|
- GITHUB_SECRET=${GITHUB_SECRET:?err}
|
|
- REDIS_URL=${REDIS_URL:?err}
|
|
- NEXT_PUBLIC_IS_CLOUD=${NEXT_PUBLIC_IS_CLOUD:-false}
|
|
- API_RATE_LIMIT=${API_RATE_LIMIT:-1}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
|
|
volumes:
|
|
database:
|
|
cache:
|