DEV Community

Cover image for How I Cut Development Setup Time from 15 Minutes to 30 Seconds with Dev Containers
Mei Park
Mei Park

Posted on

How I Cut Development Setup Time from 15 Minutes to 30 Seconds with Dev Containers

It's 9:15 PM. You've got 45 minutes before you collapse from exhaustion. You fire up your laptop, clone that project you were working on last week, and… wait. Which Node version was this? Did you install the right linter? Where's that extension you rely on for auto-formatting?

By the time you've recreated your development environment, you have maybe 15 minutes left to actually code.

This is why dev containers are a game-changer for parent developers. Set up your perfect environment once, and it works the same way whether you're coding on your main laptop, the family computer, or that old desktop you pulled out of storage.

Why Dev Containers Are Perfect for Parent Developers

🔄 Consistency Across Chaos

Tried installing that new build tool and broke your Node setup? No problem. Your unbroken environment lives in the container, ready to go again.

⚡ Zero Setup Time

Clone repo, open in VSCode, and you're instantly in your perfect development environment. No "what did I install last time?" detective work.

🧪 Isolated Experiments

Try new tools or versions without breaking your main setup. Perfect for when you want to test something during a quick 10-minute window.

🔮 Share with Future You

Six months from now, when you revisit this project, everything still works exactly the same way.

🌐 Works Everywhere

This setup works identically whether you're running locally (with Docker + Dev Containers extension) or in GitHub Codespaces. Codespaces even lets you code on your phone! Perfect for when you're at the playground and suddenly figure out the solution to yesterday's bug.

The Essential Parent Developer Dev Container

Here's my battle-tested .devcontainer/devcontainer.json that I use across all my projects. Don't forget to update your name and email in the postCreateCommand if you're stealing this:

Development environment setup

{
  "name": "Parent Developer Environment",
  "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
  "features": {
    "ghcr.io/devcontainers/features/github-cli:1": {},
    "ghcr.io/devcontainers/features/hugo:1": {}
  },
  "customizations": {
    "vscode": {
      "extensions": [
        // AI Assistants - Your fragmented-time superpowers
        "anthropic.claude-code",
        "github.copilot",
        "github.copilot-chat",

        // Auto-save and sync - Never lose work again
        "ms-vscode.vscode-json",
        "bradlc.vscode-tailwindcss",
        "esbenp.prettier-vscode",
        "ms-vscode.vscode-typescript-next",

        // Git workflow optimization
        "eamodio.gitlens",
        "github.vscode-pull-request-github",
        "ms-vscode.vscode-merge-conflict",

        // Quick navigation and search
        "ms-vscode.vscode-json",
        "christian-kohler.path-intellisense",
        "formulahendry.auto-rename-tag",

        // Error prevention and code quality
        "ms-vscode.vscode-eslint",
        "ms-vscode.vscode-typescript-next",
        "bradlc.vscode-tailwindcss",

        // Productivity boosters
        "formulahendry.code-runner",
        "ms-vscode.vscode-json",
        "redhat.vscode-yaml",
        "ms-vscode.vscode-json",

        // Theme and comfort
        "pkief.material-icon-theme"
      ],
      "settings": {
        // Auto-save everything - the parent developer's safety net
        "files.autoSave": "afterDelay",
        "files.autoSaveDelay": 1000,
        "git.autofetch": true,
        "git.enableSmartCommit": true,
        "git.confirmSync": false,

        // Format on save - one less thing to think about
        "editor.formatOnSave": true,
        "editor.formatOnPaste": true,
        "editor.codeActionsOnSave": {
          "source.fixAll.eslint": "always",
          "source.organizeImports": "always"
        },

        // Visual improvements - because you deserve a nice workspace
        "editor.fontFamily": "'JetBrainsMono Nerd Font', 'JetBrains Mono', Menlo, Monaco, 'Courier New', monospace",
        "editor.fontSize": 14,
        "editor.fontLigatures": true,
        "editor.lineHeight": 1.5,
        "editor.tabSize": 2,
        "editor.insertSpaces": true,
        "editor.detectIndentation": true,
        "editor.bracketPairColorization.enabled": true,
        "editor.guides.bracketPairs": true,

        // Intelligent suggestions - help when brain is tired
        "editor.quickSuggestions": {
          "other": true,
          "comments": true,
          "strings": true
        },
        "editor.suggestOnTriggerCharacters": true,
        "editor.acceptSuggestionOnCommitCharacter": true,
        "editor.acceptSuggestionOnEnter": "on",
        "editor.tabCompletion": "on",
        "editor.snippetSuggestions": "top",
        "editor.wordBasedSuggestions": "matchingDocuments",

        // Better diff viewing for when you return to old work
        "diffEditor.ignoreTrimWhitespace": false,
        "diffEditor.renderSideBySide": true,

        // Optimize for quick context switching
        "workbench.editor.enablePreview": false,
        "workbench.editor.showTabs": "multiple",
        "workbench.editor.wrapTabs": true,

        // File management for chaos
        "explorer.confirmDelete": false,
        "explorer.confirmDragAndDrop": false,
        "explorer.sortOrder": "type",
        "explorer.fileNesting.enabled": true,
        "explorer.fileNesting.patterns": {
          "*.ts": "${capture}.js, ${capture}.d.ts.map, ${capture}.d.ts, ${capture}.js.map",
          "*.tsx": "${capture}.ts, ${capture}.js",
          "package.json": "package-lock.json, yarn.lock, pnpm-lock.yaml",
          "*.vue": "${capture}.vue.d.ts",
          "README.md": "*.md"
        },

        // File handling - keep it tidy
        "files.trimTrailingWhitespace": true,
        "files.trimFinalNewlines": true,
        "files.insertFinalNewline": true,
        "files.exclude": {
          "**/.git": true,
          "**/.DS_Store": true,
          "**/node_modules": true,
          "**/.next": true,
          "**/dist": true,
          "**/build": true,
          "**/.vscode": false
        },
        "files.watcherExclude": {
          "**/.git/objects/**": true,
          "**/.git/subtree-cache/**": true,
          "**/node_modules/*/**": true,
          "**/.next/**": true,
          "**/dist/**": true
        },
        "typescript.disableAutomaticTypeAcquisition": false,
        "typescript.updateImportsOnFileMove.enabled": "always",
        "search.exclude": {
          "**/node_modules": true,
          "**/bower_components": true,
          "**/*.code-search": true,
          "**/dist": true,
          "**/build": true
        },

        // Terminal optimization
        "terminal.integrated.defaultProfile.linux": "bash",
        "terminal.integrated.copyOnSelection": true,
        "terminal.integrated.fontSize": 13,
        "terminal.integrated.fontFamily": "'JetBrainsMono Nerd Font', 'JetBrains Mono', Menlo",
        "terminal.integrated.cursorBlinking": true,
        "terminal.integrated.cursorStyle": "line",
        "terminal.integrated.scrollback": 10000,

        // GitHub integration
        "github.copilot.enable": {
          "*": true,
          "plaintext": false,
          "markdown": true
        },

        // Theme settings for late-night coding (with auto dark mode)
        "window.autoDetectColorScheme": true,
        "workbench.colorTheme": "Monokai",
        "workbench.iconTheme": "material-icon-theme",
        "workbench.preferredDarkColorTheme": "Monokai",
        "workbench.preferredLightColorTheme": "Quiet Light",

        // Prettier configuration
        "prettier.singleQuote": true,
        "prettier.semi": true,
        "prettier.tabWidth": 2,

        // ESLint settings
        "eslint.run": "onSave"
      }
    }
  },
  "containerEnv": {
    "GIT_EDITOR": "code --wait"
  },
  "postCreateCommand": "npm install -g @anthropic-ai/claude-code && git config --global user.email 'your@email.com' && git config --global user.name 'Your Name' && [ -f package.json ] && npm install || true",
  "remoteUser": "node",
  "forwardPorts": [3000, 8000, 1313],
  "mounts": [
    "source=parentdev-bashhistory,target=/home/node/.bash_history,type=volume"
  ]
}
Enter fullscreen mode Exit fullscreen mode

Note: This setup includes auto dark mode using VSCode's native window.autoDetectColorScheme setting, so your theme will automatically switch between "Quiet Light" (day) and "Monokai" (night) based on your system's appearance. You may still need to manually select your preferred theme initially from the Command Palette (Cmd+Shift+P on Mac or Ctrl+Shift+P on Windows/Linux → "Preferences: Color Theme").

Setting Up Your First Dev Container

VSCode development

  1. Install the Dev Containers extension in VSCode (or select "Yes" in the popup when you create a .devcontainer/devcontainer.json file)

  2. Create the folder structure:

your-project/
├── .devcontainer/
│   └── devcontainer.json
└── your-code/
Enter fullscreen mode Exit fullscreen mode
  1. Copy the configuration above into devcontainer.json

  2. Open in container: Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux) → "Dev Containers: Reopen in Container"

For an easy way to set up authentication for GitHub, run gh auth login in the container terminal.

Adding Bash Aliases (Optional Enhancement)

Once you have the basic container working, you can add custom aliases to make your workflow even faster. Create .devcontainer/bashrc:

# Custom prompt - shows current folder and git branch
parse_git_branch() {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

# Nice colored prompt: folder (git-branch) $
PS1='\[\033[1;36m\]\W\[\033[1;33m\]$(parse_git_branch)\[\033[0m\] $ '

# Emergency git workflows
alias save='git add . && git commit -m "WIP: interrupted by life" && git push'
alias quickfix='git pull --rebase && git add . && git commit -m "Quick fix" && git push'
alias backup='git add . && git commit -m "Backup before trying something" && git push'

# Container-specific shortcuts
alias dev='npm run dev'
alias build='npm run build'
alias test='npm test'
alias serve='npm run serve'

# Quick navigation
alias ll='ls -la'
alias ..='cd ..'
alias ...='cd ../..'

# Git helpers
alias last='git log --oneline -5'
alias status='git status && echo "---" && git log --oneline -3'
alias main='git checkout main && git pull'

# Process management
alias ports='lsof -i -P -n | grep LISTEN'
alias killnode='pkill -f node'
Enter fullscreen mode Exit fullscreen mode

Then add this line to your devcontainer.json mounts array:

  "mounts": [
    "source=${localWorkspaceFolder}/.devcontainer/bashrc,target=/home/node/.bashrc,type=bind", // Add this line
    "source=parentdev-bashhistory,target=/home/node/.bash_history,type=volume"
  ]
Enter fullscreen mode Exit fullscreen mode

Extension Breakdown: What Each One Does for Parent Developers

AI Assistants (The Game Changers)

Claude Code + GitHub Copilot: Your context-switching superpowers. Claude Code excels at understanding entire codebases and helping you pick up where you left off after interruptions. When you open a file after three days and can't remember what you were doing, ask Claude to analyze your recent commits and explain what you were building. Copilot handles the line-by-line suggestions and boilerplate generation.

GitHub Copilot Chat: Perfect for those "what was I thinking?" moments. Ask it to explain functions, suggest improvements, or help debug issues without leaving VSCode.

Alternatives: If you prefer more flexibility with AI models, Continue (continue.continue) is an open-source alternative that works with multiple providers including local models. Cline (saoudrizwan.claude-dev) is another popular choice that integrates well with Claude and other AI models.

Auto-Save and Sync (Never Lose Work Again)

Auto-save after 1 second: Because who remembers to hit the save keyboard shortcut when baby wakes up crying?

Git auto-fetch: Keeps your local repo in sync without you thinking about it.

Smart commit enabled: Automatically stages all changes when you commit, turning the two-step "stage then commit" process into one action. Perfect for quick "save everything before the kid wakes up" moments.

Visual Improvements (Because You Deserve a Nice Workspace)

JetBrains Mono Nerd Font: A beautiful, readable monospace font with ligatures that makes code easier to scan when you're tired.

Bracket pair colorization and guides: Visual cues that help you quickly understand code structure, especially useful when jumping back into complex files.

File nesting patterns: Groups related files together in the explorer (like grouping .ts files with their .js and .map files) to reduce visual clutter.

Smart file exclusions: Hides build artifacts, node_modules, and other noise from search and file watching to keep performance snappy.

Enhanced terminal: Consistent font with your editor, better scrollback, and visual improvements for a more polished experience.

Git Workflow Optimization

GitLens: See who changed what and when. Perfect for when you're trying to remember why you made a change last week.

GitHub Pull Request: Create and manage PRs without leaving VSCode. Essential for maintaining clean git history even in fragmented time.

Merge Conflict: Visual conflict resolution that's fast and intuitive.

Quick Navigation and Search

Path Intellisense: Autocomplete for file paths. Saves mental energy when you're tired.

Auto Rename Tag: Change one HTML tag and its closing tag updates automatically.

Enhanced IntelliSense: Comprehensive suggestion settings that prioritize snippets and provide smarter autocomplete based on your project context.

Error Prevention and Code Quality

ESLint: Catch errors before they become problems. Set to auto-fix on save using the updated codeActionsOnSave settings.

Prettier: Consistent code formatting without thinking about it.

TypeScript: Better autocomplete and error catching, with automatic import updates when you move files around.

The Parent Developer Advantage

Coding productivity

Here's what I've learned after using dev containers for everything:

  • Setup time went from 10-15 minutes to 30 seconds. That's huge when you only have 45 minutes to code.
  • Context switching became painless. Open any project, any time, and you're immediately productive.
  • Experimentation became safe. Try new tools, break things, and reset without affecting your main environment.

Ready to eliminate environment setup from your parent developer workflow? Try the configuration above and get back to what matters: building something amazing in those precious fragments of time.


What's your biggest time-waster when setting up development environments? Share your struggles (and wins!) in the comments below. If this configuration helped you reclaim some precious coding time, I'd love to hear about it!

Found this helpful? Give it a ❤️ and follow me for more parent developer productivity tips. Got questions about specific extensions or want to suggest improvements to this setup? Drop them in the comments!

Top comments (0)