VS Code Dev Container Fullstack
Complete development environment with VS Code Server and fullstack tools.
Overview
code-server brings VS Code's full IDE experience to any device through a web browser, eliminating the need for local installations while maintaining access to extensions, integrated terminals, and debugging capabilities. Originally created by Coder to enable remote development, it has become the foundation for cloud-based development environments that offer consistent tooling across teams and devices. This fullstack development container combines code-server with Node.js 20 and Python 3.11 runtimes alongside PostgreSQL for robust relational data storage and Redis for high-performance caching and session management. The stack includes MailHog for email testing during development and Adminer for database administration, creating a complete development ecosystem within isolated containers. Remote development teams, consultants working across multiple client environments, and organizations standardizing development toolchains will find this combination particularly valuable for maintaining consistency while enabling flexible access from any device with a modern web browser.
Key Features
- Full VS Code interface accessible through web browser with extension marketplace support
- Node.js 20 Alpine runtime with persistent node_modules volume for JavaScript/TypeScript development
- Python 3.11 slim container with virtual environment persistence for backend API development
- PostgreSQL 15 with ACID compliance, JSON/JSONB support, and full-text search capabilities
- Redis 7 in-memory data structures for sub-millisecond caching, session storage, and pub/sub messaging
- MailHog SMTP testing server with web interface for capturing and inspecting development emails
- Adminer web-based database administration with support for PostgreSQL schema management
- Persistent workspace synchronization across container restarts and updates
Common Use Cases
- 1Remote fullstack development teams building web applications with JavaScript frontend and Python backend
- 2Consulting developers who need consistent environments across different client projects and machines
- 3Educational institutions providing standardized development environments for coding bootcamps and computer science courses
- 4Companies developing applications with PostgreSQL databases requiring email functionality testing
- 5Freelancers working on Chromebooks or tablets who need access to a full development environment
- 6Startups building MVP applications with real-time features using Redis pub/sub and PostgreSQL persistence
- 7Development teams creating API services that require session management, caching, and transactional data storage
Prerequisites
- Docker Engine 20.10+ and Docker Compose V2 with minimum 4GB RAM allocated to containers
- Available ports 8443, 8080, 8025, 1025, 5432, and 6379 on the host system
- CODE_PASSWORD and POSTGRES_PASSWORD environment variables configured in .env file
- Basic understanding of VS Code extensions and terminal usage for development workflows
- Familiarity with PostgreSQL connection strings and Redis CLI commands for database interactions
- Modern web browser with JavaScript enabled for accessing code-server interface
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 code-server: 3 image: codercom/code-server:latest4 ports: 5 - "8443:8443"6 environment: 7 - PASSWORD=${CODE_PASSWORD}8 volumes: 9 - ./workspace:/home/coder/project10 - code_server_data:/home/coder/.local11 user: root12 networks: 13 - dev_net1415 node: 16 image: node:20-alpine17 working_dir: /app18 volumes: 19 - ./workspace:/app20 - node_modules:/app/node_modules21 command: tail -f /dev/null22 networks: 23 - dev_net2425 python: 26 image: python:3.11-slim27 working_dir: /app28 volumes: 29 - ./workspace:/app30 - python_venv:/app/.venv31 command: tail -f /dev/null32 networks: 33 - dev_net3435 postgres: 36 image: postgres:15-alpine37 environment: 38 - POSTGRES_USER=dev39 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}40 - POSTGRES_DB=devdb41 volumes: 42 - postgres_data:/var/lib/postgresql/data43 ports: 44 - "5432:5432"45 networks: 46 - dev_net4748 redis: 49 image: redis:7-alpine50 ports: 51 - "6379:6379"52 volumes: 53 - redis_data:/data54 networks: 55 - dev_net5657 mailhog: 58 image: mailhog/mailhog:latest59 ports: 60 - "1025:1025"61 - "8025:8025"62 networks: 63 - dev_net6465 adminer: 66 image: adminer:latest67 ports: 68 - "8080:8080"69 networks: 70 - dev_net7172volumes: 73 code_server_data: 74 node_modules: 75 python_venv: 76 postgres_data: 77 redis_data: 7879networks: 80 dev_net: .env Template
.env
1# Dev Container2CODE_PASSWORD=secure_code_password3POSTGRES_PASSWORD=secure_postgres_password45# Code Server at http://localhost:84436# Mailhog at http://localhost:80257# Adminer at http://localhost:8080Usage Notes
- 1Code Server at http://localhost:8443
- 2Mailhog for email testing at http://localhost:8025
- 3Adminer at http://localhost:8080
- 4Node and Python containers ready
- 5Install extensions in Code Server
Individual Services(7 services)
Copy individual services to mix and match with your existing compose files.
code-server
code-server:
image: codercom/code-server:latest
ports:
- "8443:8443"
environment:
- PASSWORD=${CODE_PASSWORD}
volumes:
- ./workspace:/home/coder/project
- code_server_data:/home/coder/.local
user: root
networks:
- dev_net
node
node:
image: node:20-alpine
working_dir: /app
volumes:
- ./workspace:/app
- node_modules:/app/node_modules
command: tail -f /dev/null
networks:
- dev_net
python
python:
image: python:3.11-slim
working_dir: /app
volumes:
- ./workspace:/app
- python_venv:/app/.venv
command: tail -f /dev/null
networks:
- dev_net
postgres
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_USER=dev
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=devdb
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- dev_net
redis
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- dev_net
mailhog
mailhog:
image: mailhog/mailhog:latest
ports:
- "1025:1025"
- "8025:8025"
networks:
- dev_net
adminer
adminer:
image: adminer:latest
ports:
- "8080:8080"
networks:
- dev_net
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 code-server:5 image: codercom/code-server:latest6 ports:7 - "8443:8443"8 environment:9 - PASSWORD=${CODE_PASSWORD}10 volumes:11 - ./workspace:/home/coder/project12 - code_server_data:/home/coder/.local13 user: root14 networks:15 - dev_net1617 node:18 image: node:20-alpine19 working_dir: /app20 volumes:21 - ./workspace:/app22 - node_modules:/app/node_modules23 command: tail -f /dev/null24 networks:25 - dev_net2627 python:28 image: python:3.11-slim29 working_dir: /app30 volumes:31 - ./workspace:/app32 - python_venv:/app/.venv33 command: tail -f /dev/null34 networks:35 - dev_net3637 postgres:38 image: postgres:15-alpine39 environment:40 - POSTGRES_USER=dev41 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}42 - POSTGRES_DB=devdb43 volumes:44 - postgres_data:/var/lib/postgresql/data45 ports:46 - "5432:5432"47 networks:48 - dev_net4950 redis:51 image: redis:7-alpine52 ports:53 - "6379:6379"54 volumes:55 - redis_data:/data56 networks:57 - dev_net5859 mailhog:60 image: mailhog/mailhog:latest61 ports:62 - "1025:1025"63 - "8025:8025"64 networks:65 - dev_net6667 adminer:68 image: adminer:latest69 ports:70 - "8080:8080"71 networks:72 - dev_net7374volumes:75 code_server_data:76 node_modules:77 python_venv:78 postgres_data:79 redis_data:8081networks:82 dev_net:83EOF8485# 2. Create the .env file86cat > .env << 'EOF'87# Dev Container88CODE_PASSWORD=secure_code_password89POSTGRES_PASSWORD=secure_postgres_password9091# Code Server at http://localhost:844392# Mailhog at http://localhost:802593# Adminer at http://localhost:808094EOF9596# 3. Start the services97docker compose up -d9899# 4. View logs100docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/devcontainer-fullstack/run | bashTroubleshooting
- code-server shows 'VS Code Server failed to start': Ensure CODE_PASSWORD environment variable is set and container has sufficient memory allocation
- Node.js modules not persisting between restarts: Verify node_modules volume is properly mounted and the container has write permissions to /app directory
- PostgreSQL connection refused from other containers: Check that services are on the same dev_net network and use service name 'postgres' instead of localhost
- Redis commands timeout or fail: Confirm Redis container is running and accessible on port 6379 within the Docker network, not from external connections
- MailHog not capturing emails from applications: Configure SMTP settings to use mailhog:1025 as the server address within the container network
- Adminer cannot connect to PostgreSQL: Use server name 'postgres', username 'dev', and ensure POSTGRES_PASSWORD matches the environment variable
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
code-servernodepythonpostgresqlredis
Tags
#devcontainer#vscode#fullstack#remote#development
Category
Development ToolsAd Space
Shortcuts: C CopyF FavoriteD Download