Files
Vaessl/docs/02-Preparation/01-code-server-adjustments.md
2026-03-25 00:33:23 +01:00

1.1 KiB

Vaessl: code-server adjustments

Before developing on code-server I configure a Dockerfile to install all packages needed for Spring Boot, Java and Vite.

I install openjdk 25, nodejs 24.x and yarn and set the environment variables for Java.

Since the linuxserver code-server image doesn't come with root access for its default user abc out of the box every privileged action will be baked in here:

FROM lscr.io/linuxserver/code-server:latest

USER root

RUN apt update && apt install -y \
    curl ca-certificates openjdk-25-jdk \
    # Add nodejs for React/Vite
    && curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
    && apt install -y nodejs \
    && rm -rf /var/lib/apt/lists/*

# Set Java Environment
ENV JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64
ENV PATH="$JAVA_HOME/bin:${PATH}"

Build the custom image and name it something like code-server-dev:

docker build -t code-server-dev .

Make sure to add code-server-dev:latest to the image env in the docker-compose file.

Now deploy the docker-compose and check all the configurations:

java --version
mvn --version
npm --version
yarn --version
nodejs --version