1
0

Added an arch VM accessible through ttyd

This commit is contained in:
Adrien Bouvais 2025-06-26 09:40:56 +00:00
parent c0244643bf
commit 817c811b3a
3 changed files with 69 additions and 0 deletions

40
Dockerfile.arch-ttyd Normal file
View File

@ -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"]

View File

@ -3,6 +3,7 @@ include:
- gitea.yml
- llm.yml
- monitoring.yml
- vms.yml
services:
traefik:

28
vms.yml Normal file
View File

@ -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