Skip to content
cccskills
FreePublished on GitHub

adding-docker

Dockerize an application with a production-ready Dockerfile, docker-compose setup, and .dockerignore.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Add Docker

Use this skill when the user asks to dockerize, containerize, or add Docker support to an application.

Steps

  1. Detect the runtime — inspect package.json, requirements.txt, go.mod, Cargo.toml, etc. to determine the language and runtime.

  2. Create a multi-stage Dockerfile

    For Node.js (example):

    FROM node:20-alpine AS base
    
    FROM base AS deps
    WORKDIR /app
    COPY package.json package-lock.json ./
    RUN npm ci --omit=dev
    
    FROM base AS build
    WORKDIR /app
    COPY package.json package-lock.json ./
    RUN npm ci
    COPY . .
    RUN npm run build
    
    FROM base AS runner
    WORKDIR /app
    ENV NODE_ENV=production
    COPY --from=deps /app/node_modules ./node_modules
    COPY --from=build /app/.next ./.next
    COPY --from=build /app/public ./public
    COPY --from=build /app/package.json ./
    EXPOSE 3000
    CMD ["npm", "start"]
    

    Adapt for the detected framework — adjust the build output directory, entry command, and base image.

  3. Create .dockerignore

    node_modules
    .next
    .git
    .env*
    *.md
    
  4. Create docker-compose.yml (if the app has dependencies like a database or Redis):

    services:
      app:
        build: .
        ports:
          - "3000:3000"
        env_file: .env
        depends_on:
          - db
      db:
        image: postgres:16-alpine
        environment:
          POSTGRES_DB: app
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
        volumes:
          - pgdata:/var/lib/postgresql/data
    volumes:
      pgdata:
    
  5. Add npm scripts (optional)

    {
      "docker:build": "docker build -t myapp .",
      "docker:run": "docker compose up"
    }
    

Notes

  • Use Alpine-based images to minimize image size.
  • Never copy .env files into the image — use env_file or runtime injection.
  • For monorepos, use a .dockerignore that excludes sibling packages not needed by the target app.
  • Add a HEALTHCHECK instruction for production deployments.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use Cursor's browser aria snapshots to audit a page for accessibility issues — missing labels, broken tab order, contrast, and ARIA misuse.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Add PostHog analytics to a web application, including event tracking, page views, feature flags, and session replay.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Generate OpenAPI/Swagger documentation for an API, including endpoint schemas, request/response types, and interactive docs UI.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Add authentication to a web application using NextAuth.js (Auth.js), including OAuth providers, session management, and protected routes.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Set up Playwright end-to-end testing in a project, including test configuration, example tests, and CI integration.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

Add Sentry error tracking, performance monitoring, and source maps to a web application.

The English summary is being prepared. Showing the original description.

0xAidan/polymarket-bot-test4Updated Sep 4, 2026

See all skills by 0xAidan

Report a problem with this skill