🌍 Step 4: Deployment
We host the site on Coolify (deploy.dalm.de). We use the Node.js Adapter for Astro, which allows us to run the site as a persistent containerized application.
1. Preparing Docker
Astro is configured to use the @astrojs/node adapter. We include a Dockerfile that:
- Installs dependencies and builds the site.
- Exposes port 3000 for the Node.js server.
- Runs the standalone server entry point.
2. Connecting to Coolify
- Log in to your Coolify instance at
deploy.dalm.de. - Create a new Project and Resource.
- Select Public Repository or Private GitHub Repository.
- Coolify will automatically detect the
Dockerfilein the root of the project.
3. Environment Variables
Since we are running in a container, environment variables must be defined in the Coolify UI under the Environment Variables tab of your resource:
GOOGLE_CLIENT_ID/_SECRET/_REFRESH_TOKENKEYSTATIC_GITHUB_CLIENT_ID/_SECRETPUBLIC_TURNSTILE_SITE_KEY/TURNSTILE_SECRET_KEYKEYSTATIC_SECRET
4. GitHub App Callback
If using Keystatic with GitHub storage, ensure your GitHub App's Callback URL is updated to point to your new domain: https://your-new-domain.com/api/keystatic/github/oauth/callback
5. The Result
Coolify monitors your repository. When you push to main, it builds a new Docker image and restarts the container with zero downtime.
🎉 Conclusion
Your transition to a self-hosted architecture is complete. The site remains:
- Fast: Pre-rendered static pages served by Node.js.
- Functional: Active server-side API for the contact form.
- Independent: You now own the infrastructure.
Happy Deploying!