Skip to content

Commit

Permalink
Add a "server" for testing (with Docker)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyundso committed Dec 7, 2023
1 parent 5a828f6 commit 260a02e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.9"

services:
server:
build:
dockerfile: docker/server.Dockerfile
command: ""
privileged: true
cgroup: host
ports:
- 127.0.0.1:2222:22
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
20 changes: 20 additions & 0 deletions docker/server.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM geerlingguy/docker-debian12-ansible

RUN apt update && \
apt install -y ca-certificates curl gnupg openssh-server && \
install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
chmod a+r /etc/apt/keyrings/docker.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt update && \
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

RUN echo "PermitEmptyPasswords yes \n \
PermitRootLogin yes \n \
PasswordAuthentication yes" > /etc/ssh/sshd_config

RUN adduser david && \
usermod -aG docker david && \
echo "david ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/david && \
passwd -d david

0 comments on commit 260a02e

Please sign in to comment.