Production Setup Guide¶
Environment Setup¶
- Copy the production environment example file:
-
Edit the
.env.productionfile: -
Set strong passwords for
ENCRYPT_KEY,JWT_REFRESH_SECRET_KEY,JWT_RESET_SECRET_KEY - Configure your database connection details
- Set up your SMTP settings for production email service
- Update Redis configuration
-
Update CORS origins for your production domain
-
Make sure the
.env.productionfile is properly copied to the/appdirectory in the Docker container. This is handled by theDockerfile.prod.
Common Issues¶
Application Startup Errors¶
If you see errors during application startup:
- Check that
.env.productionexists in the backend directory - Verify that all required environment variables are set
- Ensure Redis settings match your Redis container configuration
- Make sure file permissions are correct in the container
- Check that paths and URLs are correct for production
Database Connection Issues¶
-
If using PostgreSQL:
-
Verify
DATABASE_HOST,DATABASE_PORT,DATABASE_USER,DATABASE_PASSWORDare correct -
Check if PostgreSQL service is running and accessible
-
If using Supabase:
- Verify
POSTGRES_URLand other Supabase-related variables are set correctly - Check if Supabase connection string includes all required parameters
Redis Connection Issues¶
- Verify Redis settings:
- Make sure Redis container is running:
Email Configuration¶
- Make sure SMTP settings are correct:
- Test email configuration with the email test endpoint
Security Settings¶
-
Ensure all security keys are strong and unique:
-
ENCRYPT_KEY JWT_REFRESH_SECRET_KEYJWT_RESET_SECRET_KEY-
SECRET_KEY -
Configure CORS for your production domain:
Deployment Steps¶
- Build production images:
- Start the services:
- Verify services are running:
- Check logs for any errors: