Back to skills
SKILL.md
1 Basic Dockerfile Patterns
BSecuritySub-skill of docker: 1. Basic Dockerfile Patterns.
- 17 stars
- 0 votes
- 0 copies
- 2 views
- Added September 9, 2026
Security analysis
85/100- Uses curl or wget to download content
- Performs destructive filesystem operations
- Installs packages at runtime which could introduce malicious dependencies
npx -y skills add vamseeachanta/workspace-hub --skill 1-basic-dockerfile-patterns --agent claude-codeAre you the author of 1 Basic Dockerfile Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vamseeachanta-1-basic-dockerfile-patterns)---
name: docker-1-basic-dockerfile-patterns
description: 'Sub-skill of docker: 1. Basic Dockerfile Patterns.'
version: 1.0.0
category: operations
type: reference
scripts_exempt: true
---
# 1. Basic Dockerfile Patterns
## 1. Basic Dockerfile Patterns
**Simple Application Dockerfile:**
```dockerfile
# Base image with specific version
FROM python:3.12-slim
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy dependency files first (better caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create non-root user
RUN useradd --create-home appuser && chown -R appuser:appuser /app
USER appuser
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
# Default command
CMD ["python", "main.py"]
```
**Node.js Application Dockerfile:**
```dockerfile
FROM node:20-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy application
COPY . .
# Non-root user (alpine already has 'node' user)
USER node
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
CMD ["node", "server.js"]
```
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.