Deploy Strategies
DeployShip auto-detects your project type and selects the appropriate deploy strategy. You can override this in project settings.
SIMPLE (default for most projects)
DeployShip runs your build command, then starts or restarts your application using PM2. Suitable for Node.js, Python, PHP, Go, Ruby, and static frontends.
Auto-detection covers:
| Stack | Detected by | Build command | Start mechanism |
|---|---|---|---|
| Next.js | next.config.* | npm run build | PM2 + next binary |
| Vite / React | vite.config.* | npm run build | PM2 + built-in static server |
| CRA | public/index.html | npm run build | PM2 + built-in static server |
| Angular | angular.json | npm run build | PM2 + built-in static server |
| Express / Fastify / NestJS | package.json | npm run build | PM2 + npm start |
| Django | manage.py | pip install | Gunicorn |
| FastAPI | main.py | pip install | Uvicorn |
| Flask | app.py | pip install | Gunicorn |
| Laravel | artisan | composer install | artisan serve |
| Go | go.mod | go build | binary execution |
| Rust | Cargo.toml | cargo build | binary execution |
| Static HTML | index.html | — | PM2 + built-in static server |
COMPOSE
If your repository contains a docker-compose.yml file, DeployShip uses
Docker Compose to build and run all services. Dependencies like PostgreSQL,
Redis, or any other service defined in your compose file are managed
automatically by Docker.
# What DeployShip runs
docker compose build --no-cache
docker compose up -d --remove-orphans
Use this strategy if your project has external dependencies (database, cache, queue workers, etc.) that you want to manage alongside your app.
Note on Ports: DeployShip dynamically assigns an internal port to route web traffic to, and provides this as a PORT environment variable via an auto-generated .env file before running Docker Compose.
To ensure the reverse proxy can connect to your application and prevent a 502 Bad Gateway error, you must bind your main service's host port to this $PORT variable in your docker-compose.yml:
services:
web:
# 127.0.0.1: adds security by not exposing the port publicly
# ${PORT:-3000} uses DeployShip's assigned port, with a local fallback
# :3000 is the internal port your app is listening on
ports: ["127.0.0.1:${PORT:-3000}:3000"]
DOCKER
If your repository contains a Dockerfile, DeployShip can use this strategy to build and run your application as a standalone container.
# What DeployShip runs
docker build -t your-project .
docker run -d --name your-project -p <PORT>:<EXPOSED_PORT> your-project
Use this strategy for projects that are containerized but do not require complex multi-container orchestration. Like Compose, PORT injection is handled via the container's exposed ports.
SCRIPT
If your repository contains a deployship.sh file in the root, DeployShip
executes it directly. You have full control over the deploy process.
#!/bin/bash
set -e
git pull origin main
npm install
npm run build
pm2 restart myapp
Use this for complex setups, monorepos, or any case where the auto-detection does not cover your workflow.
Was this page helpful?