deployship
Docs
Deploy Strategies

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:

StackDetected byBuild commandStart mechanism
Next.jsnext.config.*npm run buildPM2 + next binary
Vite / Reactvite.config.*npm run buildPM2 + built-in static server
CRApublic/index.htmlnpm run buildPM2 + built-in static server
Angularangular.jsonnpm run buildPM2 + built-in static server
Express / Fastify / NestJSpackage.jsonnpm run buildPM2 + npm start
Djangomanage.pypip installGunicorn
FastAPImain.pypip installUvicorn
Flaskapp.pypip installGunicorn
Laravelartisancomposer installartisan serve
Gogo.modgo buildbinary execution
RustCargo.tomlcargo buildbinary execution
Static HTMLindex.htmlPM2 + 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?