Frameworks & Docker
PreviewDrop detects your stack, builds the container, and runs it. Here's what works out of the box and how to override the detected commands.
PORT environment variable and (2) bind to 0.0.0.0, not 127.0.0.1. Get those right and everything else is auto-detection.Auto-detection
PreviewDrop inspects the project, picks a build plan, and builds the container for you. You don't write a Dockerfile— and if your repo already has one, it is not used. Supported stacks include:
- Node.js — package.json with start script, pnpm/yarn/npm lockfiles.
- Python — requirements.txt, Poetry (pyproject.toml), Pipenv.
- Ruby — Gemfile with Rails or Sinatra.
- Go — go.mod + main.go.
- Java / Kotlin — Maven (pom.xml), Gradle (build.gradle).
- PHP — composer.json with Laravel, Symfony, or plain PHP.
- Rust — Cargo.toml.
- .NET — .csproj.
Overriding the detected commands
Auto-detection usually gets the basics right. When it doesn't — a custom build step, a migration before boot, a non-standard entrypoint — set the Install command, Build command or Start command in Project Settings → Build settings. Blank fields keep the detected default. Changes apply on the next deployment.
Listen on $PORT and 0.0.0.0
PreviewDrop sets PORT for your container and routes traffic to it, so your start command must honour it. There is no separate exposed-port setting.
Start command examples# Node node server.js # server.js: app.listen(process.env.PORT, "0.0.0.0") # Django python manage.py migrate --noinput && gunicorn project.wsgi --bind 0.0.0.0:$PORT # Rails bundle exec rails db:migrate && bundle exec rails s -b 0.0.0.0 -p $PORT # Laravel php artisan migrate --force && php artisan serve --host 0.0.0.0 --port $PORT # FastAPI uvicorn app.main:app --host 0.0.0.0 --port $PORT # Spring Boot java -jar target/app.jar --server.port=$PORT --server.address=0.0.0.0
Framework guides
Each guide lists the environment variables and gotchas for that stack (ALLOWED_HOSTS and CSRF origins for Django, SECRET_KEY_BASE and force_ssl for Rails, APP_KEY and trusted proxies for Laravel, and so on): Django, Rails, Laravel, FastAPI, Spring Boot, Next.js.
For Django previews, set ALLOWED_HOSTS=* in your env vars — or .previews.previewdrop.dev if you want it tighter.
Build cache
PreviewDrop caches dependency downloads and image layers across deployments of the same project, so repeat builds usually finish faster than the first one. Committing a lockfile (package-lock.json, Gemfile.lock, poetry.lock) keeps the cache hits stable.
What if my app needs a database?
Two patterns work well:
- Shared dev DB. Point every preview at the same shared dev/staging Postgres via
DATABASE_URL. Simplest; good for early-stage teams. - Branch DBs. Pair PreviewDrop with Neon or PlanetScale branching. Resolve the branch's DB URL at startup (for example in your start command) so migrations stay isolated. Variables in the Variables tab apply to every preview of a project.
See Environment variables for how variables are injected.