Source Deployment
Deploy apps directly from source code.
How It Works
bp pushpackages your source into a tarball- Uploads to the Basepod server
- Server builds a Docker image from your Dockerfile
- Deploys the container
Requirements
Your project needs a Dockerfile in the root directory.
Quick Start
bash
cd myproject
bp init
bp pushConfiguration
Create basepod.yaml in your project root:
yaml
name: myapp
port: 3000
build:
dockerfile: Dockerfile
context: .
env:
NODE_ENV: productionExample 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 80Ignored Files
These are automatically excluded from uploads:
.gitnode_modules.env,.env.local__pycache__,*.pyc.DS_Storevendordist,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.comMulti-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 push again:
bash
# Make changes
git commit -am "Update"
# Deploy
bp pushThe server will:
- Build a new image
- Stop the old container
- Start the new container
- Clean up old images