── GENERATED OUTPUT ──
Docker
Language-specific, production-ready Dockerfiles with multi-stage builds.
## Generation
bash
exo gen dockerGenerates a Dockerfile in the project root. The template is selected based on the language field in .exo.yaml.
## Go Dockerfile
Dockerfile
1# ── Build Stage ──2FROM golang:1.21-alpine AS builder3WORKDIR /app4COPY go.mod go.sum ./5RUN go mod download6COPY . .7RUN CGO_ENABLED=0 GOOS=linux go build -o /app-name89# ── Runtime Stage ──10FROM alpine:latest11RUN apk --no-cache add ca-certificates12WORKDIR /root/13COPY --from=builder /app-name .14EXPOSE 808015CMD ["./app-name"]## Node.js Dockerfile
Dockerfile
1FROM node:18-alpine AS builder2WORKDIR /app3COPY package*.json ./4RUN npm ci --only=production56FROM node:18-alpine7WORKDIR /app8COPY --from=builder /app/node_modules ./node_modules9COPY . .10EXPOSE 300011CMD ["node", "index.js"]## Python Dockerfile
Dockerfile
1FROM python:3.11-slim2WORKDIR /app3COPY requirements.txt .4RUN pip install --no-cache-dir -r requirements.txt5COPY . .6EXPOSE 80007CMD ["python", "app.py"]## Features
▸ Multi-stage builds for smaller final images
▸ Alpine base images for minimal attack surface
▸ Dependency caching via layer ordering
▸ CGO disabled for Go (static binary)
▸ Production-only npm install for Node
▸ No-cache pip install for Python