This sample demonstrates a Next.js frontend with Payload CMS backend requiring MongoDB. Follow these steps to test the Docker build network integration solution.
- Dokploy instance running
- GitHub account with repository access
-
In Dokploy:
Services → New Service → Database- Name:
mongo-db - Type: MongoDB
- Version: 5.0+ (recommended)
- Name:
-
Note the Internal Connection URL (format:
mongodb://<service-name>:27017)
-
Create New Application
- Name:
dokploy-sample-app - Git Provider: Select your provider
- Repository URL:
https://github.com/ihsanhere/dokploy-deployment-sample
- Name:
-
Build Method
- Select:
Dockerfile
- Select:
-
Environment Variables
DATABASE_URI=mongodb://mongo-db:27017/dokploy-deployment-sample PAYLOAD_SECRET=<your_random_string> NEXT_PUBLIC_SERVER_URL=http://localhost:3000 CRON_SECRET=<your_random_string> PREVIEW_SECRET=<your_random_string>
-
Replace
<your_random_string>with secure values (use password generator) -
Replace the
DATABASE_URIwith the Internal Connection URL from the mongo db service
-
- Check build logs for successful MongoDB connection
- Access Payload CMS admin at
/admin - Check app logs to see nextjs running successfully
- 🔒 Database is not publicly exposed - internal networking only
- 🔄 UFW firewall rules won't affect internal service communication
⚠️ Other build methods (Nixpacks/Heroku) require separate network configuration