This commit is contained in:
tavo 2024-11-10 20:53:14 -06:00
parent 4a15361400
commit 63a902644c
4 changed files with 40 additions and 0 deletions

25
dev/Dockerfile Normal file
View file

@ -0,0 +1,25 @@
FROM debian:latest
RUN apt-get update && \
apt-get install -y sudo exa curl ffmpeg imagemagick groff openssh-server build-essential git neovim python3 python-is-python3 python3-pip golang clang clang-format nodejs npm php-fpm r-recommended && \
mkdir /var/run/sshd
RUN useradd -ms /bin/bash dev
RUN echo "dev ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
ARG SSH_KEY
RUN mkdir -p /home/dev/.ssh && \
echo "$SSH_KEY" >> /home/dev/.ssh/authorized_keys && \
chown -R dev:dev /home/dev/.ssh && \
chmod 600 /home/dev/.ssh/authorized_keys
RUN git clone https://git.tavo.one/tavo/dotfiles /home/dev/.config && \
echo ". ~/.config/shell/env-min" >> /home/dev/.bash_profile && \
echo ". ~/.config/shell/env-min" >> /home/dev/.bashrc && \
echo ". ~/.config/shell/bashrc" >> /home/dev/.bash_profile && \
echo ". ~/.config/shell/bashrc" >> /home/dev/.bashrc && \
chown -R dev:dev /home/dev
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

5
dev/build.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
podman rm -f dev
podman build --build-arg SSH_KEY="$(cat ~/.ssh/id_ed25519.pub)" -t debian-dev-env .
podman run -d --name dev -p 2222:22 debian-dev-env

3
dev/deploy.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
podman run -d --restart=always --name dev -p 2222:22 debian-dev-env

7
dev/purge.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
podman rm -f $(podman ps -a -q)
podman rmi -f $(podman images -a -q)
podman volume rm $(podman volume ls -q)
podman network prune -f
podman system prune -a -f