Skip to content

About

Dockerized code-server (VS Code in the browser) with a ready toolchain: Python 3.12 venv, Java 21 (Temurin) and Groovy 5 via SDKMAN. Build from source or run a prebuilt image via Docker Compose.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

code-server-docker

English | Русский

Docker environment for code-server (VS Code in the browser) with a ready-to-use toolchain: Python 3.12 + venv, Java 21 (Temurin) and Groovy 5 via SDKMAN. This repository demonstrates the image build implementation; no application code is included in the public version — the workspace folder is empty and serves as the entry point for your own code.

Structure

.
├── docker-compose.yml            # build the image from source and run it
├── docker-compose.prebuilt.yml   # run an already-built image (no build step)
├── .env.example                  # environment variable template
└── code-server/
    ├── Dockerfile.Ubuntu-24.04   # build on top of ubuntu:24.04 (python from apt)
    ├── Dockerfile.Ubuntu-26.04   # build on top of ubuntu:26.04 (python from source)
    ├── requirements.txt          # pinned Python dependencies for the venv
    └── workspace/                # working folder inside the container (/home/coder/workspace)

Build logic

Both Dockerfiles do the same thing; they differ only in the base image and how Python is installed:

  1. System packages — curl, build-essential, zip/unzip, git, build libraries.
  2. code-server — installed from the official .deb on GitHub releases; the version is set via ENV CODE_SERVER_VERSION.
  3. User — a non-root coder user is created with passwordless sudo.
  4. Python environment — a venv at /home/coder/.venv, dependencies installed from requirements.txt (pinned versions: pandas, numpy, opencv, torch, transformers, paddleocr, lxml, etc.); the venv is added to PATH.
  5. Java + Groovy — via SDKMAN: Java 21.0.4-tem and Groovy 5.0.5 (both set as default); JAVA_HOME/GROOVY_HOME are added to PATH, and SDKMAN initialization is added to .bashrc.
  6. Working folder — workspace/ is copied to /home/coder/workspace and opened by code-server on startup.

The image is built via docker compose (build.context: ./code-server/); the image tag comes from the CODE_SERVER_VERSION variable.

Quick start

cp .env.example .env      # and change PASSWORD
docker compose up --build # build + run (Dockerfile.Ubuntu-24.04)

The UI is at http://localhost:8080, the password is the one from PASSWORD.

Alternatives

# another base image: in docker-compose.yml switch
# dockerfile: Dockerfile.Ubuntu-26.04

# run without building (image already built or in a registry)
docker compose -f docker-compose.prebuilt.yml up

Configuration

Variable Purpose
CODE_SERVER_VERSION code-server version and image tag
PASSWORD web UI password
PORT host port (the container always listens on 8080)
USER user inside the container
IMAGE (prebuilt) image name in a registry

Resources: the container is limited to 4 GB of memory; the healthcheck polls /healthz every 10 seconds.

Security

  • .env is in .gitignore — real passwords never get committed.
  • The password is passed to the container via environment, not baked into the image.
  • .gitignore also excludes logs, __pycache__, and input/output files under workspace/ so working data can't accidentally end up in a commit.

Requirements

  • Docker + Docker Compose v2
  • ~6 GB of disk for the image (torch and paddle are among the dependencies)

About

Dockerized code-server (VS Code in the browser) with a ready toolchain: Python 3.12 venv, Java 21 (Temurin) and Groovy 5 via SDKMAN. Build from source or run a prebuilt image via Docker Compose.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors