Sample Dockerfiles

Ready-to-use templates for common app stacks

Persistent storage & seed data

Clouderized mounts /app/data in every container as a persistent volume — data survives redeploys. To seed initial files, place them in a data/ folder at the root of your repo. On first deploy only, these files are copied into /app/data. Subsequent deploys leave existing data untouched.

Use /app/data for: SQLite databases, uploaded files, config files, caches.

Python

Starter Pro

Flask + Gunicorn

# Sample Dockerfile — Python app (Flask + Gunicorn)
# Compatible with Starter and Pro tiers on Clouderized
#
# Replace app:app with your Flask application module and instance name.
# The /app/data directory is bind-mounted by Clouderized for persistent storage.

FROM python:3.12-slim
WORKDIR /app

# Install dependencies first (better layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application source
COPY . .

# Create data directory for persistent storage
RUN mkdir -p /app/data

# Port your app listens on — must match EXPOSE and clouderized.yaml port
EXPOSE 5000

CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "app:app"]

Node.js

Starter Pro

Express.js, Fastify, Hono, or similar

# syntax=docker/dockerfile:1
# Clouderized sample — Node.js app
# Tested on: Starter tier (512MB / 0.5 vCPU), Pro tier (2GB / 2 vCPU)
#
# Requirements:
#   - package.json and package-lock.json at repo root
#   - Entry point: server.js (adjust CMD if different)
#   - App must listen on the port declared in clouderized.yaml

# Build stage — install dependencies
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production

# Runtime stage — lean image
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY . .
# Persistent data directory — bind-mounted by Clouderized
RUN mkdir -p /app/data
EXPOSE 3000
CMD ["node", "server.js"]

HTML / Static

Starter Pro

nginx:alpine

# Sample Dockerfile — Static site (nginx)
# Compatible with Starter and Pro tiers on Clouderized
#
# Place your static files in a dist/ directory, or adjust the COPY path.
# Provide a custom nginx.conf if you need to configure routing or caching.

FROM nginx:alpine

# Custom nginx config (optional — remove this line to use nginx defaults)
COPY nginx.conf /etc/nginx/nginx.conf

# Copy static site files
COPY dist/ /usr/share/nginx/html/

# Port nginx listens on — must match EXPOSE and clouderized.yaml port
EXPOSE 80

Ruby

Starter Pro

Rails / Sinatra + Puma

# Sample Dockerfile — Ruby app (Rails / Sinatra + Puma)
# Compatible with Starter and Pro tiers on Clouderized
#
# Adjust the CMD for your entry point (rails server, rackup, etc.)
# The /app/data directory is bind-mounted by Clouderized for persistent storage.

FROM ruby:3.3-slim
WORKDIR /app

# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential libsqlite3-dev && rm -rf /var/lib/apt/lists/*

# Install gems (cached layer)
COPY Gemfile Gemfile.lock ./
RUN bundle install --without development test

# Copy application source
COPY . .

# Persistent storage directory
RUN mkdir -p /app/data

# Port your app listens on — must match EXPOSE and clouderized.yaml port
EXPOSE 3000

CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]

JVM / Scala / Thorium

Pro only

eclipse-temurin (Scala/sbt)

# Sample Dockerfile — JVM app (Scala/sbt)
# Requires Pro tier on Clouderized (JVM needs 2GB RAM minimum)
#
# Adjust SCALA_VERSION and the sbt assembly command for your project.
# The /app/data directory is bind-mounted by Clouderized for persistent storage.

FROM eclipse-temurin:25-jdk AS builder
WORKDIR /build

# Cache dependencies before copying source
COPY build.sbt ./
COPY project/ project/
RUN sbt update

# Build fat JAR
COPY src/ src/
RUN sbt assembly

# --- Runtime stage ---
FROM eclipse-temurin:25-jre-alpine
WORKDIR /app

# Create non-root user
RUN addgroup -S app && adduser -S app -G app
# Persistent data directory — bind-mounted by Clouderized
RUN mkdir /app/data && chown app:app /app/data

COPY --from=builder /build/target/scala-*/app-assembly-*.jar app.jar

# Port your app listens on — must match EXPOSE and clouderized.yaml port
EXPOSE 8080

CMD ["java", "-jar", "app.jar"]