diff --git a/Dockerfile.arch-ttyd b/Dockerfile.arch-ttyd new file mode 100644 index 0000000..67314f2 --- /dev/null +++ b/Dockerfile.arch-ttyd @@ -0,0 +1,40 @@ +FROM archlinux:latest + +# Update system and install essential packages +RUN pacman -Syu --noconfirm && \ + pacman -S --noconfirm \ + base-devel \ + git \ + wget \ + vim \ + nvim \ + nano \ + htop \ + lazygit \ + ttyd \ + sudo \ + which \ + net-tools \ + iputils \ + bind-tools \ + openssh && \ + pacman -Scc --noconfirm + +# Create a workspace directory +RUN mkdir -p /data + +# Create entrypoint script +RUN echo '#!/bin/bash' > /entrypoint.sh && \ + echo 'chmod 600 /root/.ssh/id_rsa' >> /entrypoint.sh && \ + echo 'exec ttyd -c $TTYD_USERNAME:$TTYD_PASSWORD -W -p 7681 bash' >> /entrypoint.sh && \ + chmod +x /entrypoint.sh + +# Install Astronvim +RUN git clone --depth 1 https://github.com/AstroNvim/template ~/.config/nvim && \ + rm -rf ~/.config/nvim/.git + +WORKDIR /data + +EXPOSE 7681 + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 39d2af4..4c7d009 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ include: - gitea.yml - llm.yml - monitoring.yml + - vms.yml services: traefik: diff --git a/vms.yml b/vms.yml new file mode 100644 index 0000000..462cddc --- /dev/null +++ b/vms.yml @@ -0,0 +1,28 @@ +services: + arch-ttyd: + build: + context: . + dockerfile: Dockerfile.arch-ttyd + container_name: arch-ttyd + restart: unless-stopped + volumes: + - ./hdd0/vms/arch/data:/data + - ./hdd0/vms/arch/root:/root + - ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro + environment: + - TTYD_USERNAME=${TTYD_USERNAME:-admin} + - TTYD_PASSWORD=${MASTER_PASSWORD:-changeme} + labels: + - "traefik.enable=true" + - "traefik.http.routers.arch.rule=Host(`arch.bouvais.lu`)" + - "traefik.http.routers.arch.entrypoints=websecure" + - "traefik.http.routers.arch.tls.certresolver=myresolver" + - "traefik.http.services.arch.loadbalancer.server.port=7681" + deploy: + resources: + limits: + cpus: '1.0' + memory: 512M + reservations: + cpus: '0.5' + memory: 256M