Files
Vaessl/docs/01-Planning/01-Technical-preparation-for-docs.md
T

3.1 KiB

Technical preparation for adding documentation

Before documenting all my research for the planning phase of the app there are several technical preparations to arrange:

  • I will be coding in a code-server docker instance so that I can develop and build my app in a central location. This way I'm not dependent on building the project on every machine I work from.
  • I will be using a locally hosted docker instance on my Proxmox server to deploy the code-server container.
  • After preparing the container I will connect it to my self hosted Git(ea) repository to ensure a git flow from the very beginning.

Code-Server docker container deployment

I use Portainer to setup my docker-compose yaml:

services:
  code-server:
    image: code-server-dev
    container_name: code-server
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Vienna
#      - PASSWORD= #optional
#      - HASHED_PASSWORD= #optional
#      - SUDO_PASSWORD=password #optional
#      - SUDO_PASSWORD_HASH= #optional
#      - PROXY_DOMAIN=code-server.my.domain #optional
      - DEFAULT_WORKSPACE=/config/workspace #optional
    volumes:
      - /home/pi/docker/vscode:/config
    ports:
      - 8443:8443
    restart: unless-stopped

Before deploying the container I configure a Dockerfile to install openjdk, maven, npm, nodejs and yarn and set the environment variables for Java to ensure the Java and React development. Since the code-server container doesn't come with root access for its default user abc out of the box every root action will be configured here:

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

USER root

RUN apt update && apt install -y \
    openjdk-25-jdk maven \
    nodejs npm \
 && npm install -g yarn \
 && rm -rf /var/lib/apt/lists/*

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

USER abc

Build the custom image and name it code-server-dev which is referenced in the docker-compose image above:

docker build -t code-server-dev .

Generate ssh keys within the code server folder to connect to my Gitea instance. Navigate to the volume and execute:

ssh-keygen -t ed25519

Save the keys to the .ssh folder.

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

java --version
mvn --version
npm --version
yarn --version
nodejs --version
ls -l /config/.ssh/id_ed25519

Copy the public key and paste it into the SSH-keys of the git instance Connect the ssh keys of code-server to the git instance (here the -p flag is necessary because I defined a separate SSH port since it is running in docker and I need to avoid using the docker SSH port):

ssh -T -p 222 git@192.168.1.208

Add the key and make the initial git commit in code-server:

mkdir where-is-my-stuff
cd where-is-my-stuff
touch README.md
git init
git config --global init.defaultBranch main
git branch -m main
git checkout -b main
git add .
git commit -m "initial commit"git config --global user.email "email@email.com"
git config --global user.name "kasun"
git commit -m "initial commit"
git remote add origin ssh://git@192.168.1.208:222/kasun/Where-is-my-stuff.git
git push -u origin main