- Create Dockerfile via UI and build.
FROM codercom/code-server:latest
USER root
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3-pip \
python3-venv \
pipx \
git \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Switch to non-root user
USER coder
# Install pipx tools globally
RUN pipx install aider-chat \
&& pipx install poetry \
&& pipx install pre-commit
# Add pipx binaries to PATH
ENV PATH="${PATH}:/home/coder/.local/bin"
# Create virtual environment directory
RUN mkdir -p /home/coder/.venvs
# Add custom VS Code extensions
RUN code-server --install-extension ms-python.python \
&& code-server --install-extension ms-toolsai.jupyter
# Create workspace directory
RUN mkdir -p /home/coder/workspace
WORKDIR /home/coder/workspace
- Add the following docker file docker-compose file
services:
code-server:
image: dev-environment:latest
container_name: dev-environment
environment:
- PUID=$PUID
- PGID=$PGID
- TZ=$TZ
- PASSWORD=${PASSWORD}
volumes:
- ./config:/home/coder/.config
- ./workspace:/home/coder/workspace
- ./.venvs:/home/coder/.venvs
- ./git-credentials:/home/coder/.git-credentials
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "8443:8080"
restart: unless-stopped
security_opt:
- seccomp:unconfined
networks:
- dev-network
networks: # better network isolation and container communication
dev-network:
name: dev-network
driver: bridge