- Digital Ocean account
- GitHub repository with your ADAdev code
- OpenAI API key
-
Prepare your repository
- Ensure your code is pushed to GitHub
- Update
app.yamlwith your actual repository details - Replace
your-username/adadevwith your actual GitHub repo
-
Deploy via Digital Ocean Console
- Go to Digital Ocean App Platform
- Click "Create App"
- Connect your GitHub repository
- Digital Ocean will automatically detect the
app.yamlconfiguration - Set environment variables:
VITE_OPENAI_API_KEY: Your OpenAI API key (server-side secret)
-
Configure Environment Variables
- In the Digital Ocean App Platform dashboard
- Go to your app settings
- Add the following environment variables:
VITE_OPENAI_API_KEY=your_openai_api_key_here NODE_ENV=production PORT=3000
-
Build and push Docker image
# Build the image docker build -t adadev . # Tag for your registry docker tag adadev your-registry/adadev:latest # Push to registry docker push your-registry/adadev:latest
-
Deploy to Digital Ocean Droplet
- Create a new Droplet
- Install Docker on the Droplet
- Run the container:
docker run -d -p 80:80 \ -e VITE_OPENAI_API_KEY=your_api_key \ your-registry/adadev:latest
| Variable | Description | Required |
|---|---|---|
VITE_OPENAI_API_KEY |
OpenAI API key for AI features | Yes |
NODE_ENV |
Environment (production/development) | No (default: production) |
PORT |
Port for the application | No (default: 3000) |
-
Add custom domain in Digital Ocean
- Go to your app settings
- Add your domain
- Update DNS records as instructed
-
SSL Certificate
- Digital Ocean App Platform provides automatic SSL
- For custom domains, SSL is automatically provisioned
- Logs: Available in Digital Ocean App Platform dashboard
- Metrics: Monitor CPU, memory, and request metrics
- Health Checks: Application includes
/healthendpoint
-
Build Failures
- Check that all dependencies are in
package.json - Ensure Node.js version compatibility (18+)
- Check that all dependencies are in
-
Runtime Errors
- Check environment variables are set correctly
- Verify OpenAI API key is valid
- Review application logs in Digital Ocean dashboard
-
Performance Issues
- Monitor resource usage in Digital Ocean dashboard
- Consider upgrading instance size if needed
- Enable caching headers (already configured in nginx.conf)
- OpenAI API key is stored as a server-side secret in Digital Ocean
- HTTPS is automatically enabled
- Security headers are configured in nginx
- No sensitive data is exposed in client-side code
- Start with
basic-xxsinstance size - Monitor usage and scale up if needed
- Consider using Digital Ocean's free tier for testing