Skip to content

Source Deployment

Deploy apps directly from source code.

How It Works

  1. bp deploy packages your source into a tarball
  2. Uploads to the Basepod server
  3. Server builds a Docker image from your Dockerfile
  4. Deploys the container

Requirements

Your project needs a Dockerfile in the root directory.

Quick Start

bash
cd myproject
bp init
bp deploy

Configuration

Create basepod.yaml in your project root:

yaml
name: myapp
port: 3000

build:
  dockerfile: Dockerfile
  context: .

env:
  NODE_ENV: production

Example Dockerfiles

Node.js

dockerfile
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["node", "index.js"]

Python

dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "app.py"]

Go

dockerfile
FROM golang:1.22-alpine AS builder
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . .
RUN go build -o main .

FROM alpine:latest
COPY --from=builder /app/main /main
EXPOSE 8080
CMD ["/main"]

Static Site

dockerfile
FROM nginx:alpine
COPY dist/ /usr/share/nginx/html/
EXPOSE 80

Ignored Files

These are automatically excluded from uploads:

  • .git
  • node_modules
  • .env, .env.local
  • __pycache__, *.pyc
  • .DS_Store
  • vendor
  • dist, build
  • .next, .nuxt, .output

Add custom ignores in .basepodignore:

*.log
tmp/
secrets/

Build Arguments

Pass build arguments:

yaml
name: myapp
build:
  dockerfile: Dockerfile
  context: .
  args:
    NODE_ENV: production
    API_URL: https://api.example.com

Multi-Stage Builds

Recommended for smaller images:

dockerfile
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY . .
RUN npm ci && npm run build

# Production stage
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 3000
CMD ["node", "dist/index.js"]

Deploying Updates

Simply run bp deploy again:

bash
# Make changes
git commit -am "Update"

# Deploy
bp deploy

The server will:

  1. Build a new image
  2. Stop the old container
  3. Start the new container
  4. Clean up old images

Released under the MIT License.