- Docker 20.10+
- Docker Compose 2.0+
- Create environment file:
cp .env.example .envEdit .env with your Auth0 credentials:
AUTH0_DOMAIN=your-tenant.auth0.com
AUTH0_AUDIENCE=https://api.openask.com
GEMINI_API_KEY=your-gemini-api-key # Optional
AUTH0_CLIENT_ID=your-client-id # For web app- Start all services:
docker-compose up -dThis starts:
- MongoDB on
localhost:27017 - API on
localhost:3000
- View logs:
docker-compose logs -f api- Seed database:
docker-compose exec api pnpm seed- Stop services:
docker-compose down- Port: 27017
- User: admin
- Password: password
- Database: openask
Connect with mongosh:
docker-compose exec mongodb mongosh -u admin -p password --authenticationDatabase admin openask- Port: 3000
- Health check: http://localhost:3000/health
- API docs: See
apps/api/README.md
Access API shell:
docker-compose exec api sh# Rebuild API container
docker-compose up -d --build api
# Or rebuild everything
docker-compose up -d --build# Run tests
docker-compose exec api pnpm test
# Type check
docker-compose exec api pnpm typecheck
# Lint
docker-compose exec api pnpm lint# All services
docker-compose logs -f
# Specific service
docker-compose logs -f api
docker-compose logs -f mongodbMongoDB data is persisted in Docker volumes:
mongodb_data- Database filesmongodb_config- MongoDB configuration
To reset database:
docker-compose down -v # Removes volumes
docker-compose up -dIf ports 3000 or 27017 are already in use:
- Edit
docker-compose.yml - Change port mappings:
ports: - '3001:3000' # API on 3001
Check MongoDB health:
docker-compose ps
docker-compose logs mongodbWait for MongoDB to be healthy:
docker-compose up -d mongodb
# Wait 10 seconds
docker-compose up -d apiView error logs:
docker-compose logs apiCheck environment variables:
docker-compose exec api env | grep AUTH0For production, use separate docker-compose.prod.yml:
docker-compose -f docker-compose.prod.yml up -dProduction checklist:
- Set
NODE_ENV=production - Use secrets management for sensitive env vars
- Configure proper MongoDB authentication
- Set up SSL/TLS certificates
- Configure reverse proxy (nginx/Caddy)
- Set up monitoring and logging
- Configure backup strategy
- Enable MongoDB replica set
# Stop and remove containers
docker-compose down
# Stop and remove containers + volumes
docker-compose down -v
# View running containers
docker-compose ps
# View resource usage
docker stats
# Access MongoDB shell
docker-compose exec mongodb mongosh -u admin -p password
# Backup MongoDB
docker-compose exec mongodb mongodump -u admin -p password --authenticationDatabase admin -o /backup
# Restore MongoDB
docker-compose exec mongodb mongorestore -u admin -p password --authenticationDatabase admin /backup