Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm run test ${{matrix.test-file}}
- run: pnpm run ci:test ${{matrix.test-file}}
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl gnupg lsb-release cron && \
mkdir -p -m 0755 /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
> /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-buildx-plugin && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl gnupg && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y --no-install-recommends git nodejs python3 python3-pip python3-apt ansible sudo openssh-client && \
npm install -g pnpm && \
curl -sSL https://nixpacks.com/install.sh | bash && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

VOLUME /var/lib/docker
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This code will do the following:
# Requirements
**On local machine:**
- [Ansible](https://www.ansible.com/) (tested with v2.16.6)
- Nodejs (tested with v22.8)
- Node.js (tested with v22.8)

**On the server**
- A Linux server that uses `apt` and `systemctl` (tested on Ubuntu 22.04)
Expand Down
439 changes: 439 additions & 0 deletions about.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
hosty:
build: .
privileged: true
volumes:
- .:/app
working_dir: /app
Comment on lines +3 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Docker will not be usable inside this container as-is (no daemon, no socket).

The image installs Docker tooling, but this service neither mounts the host Docker socket nor starts dockerd (DinD). As a result, docker commands will fail at runtime.

Choose one of the following fixes:

Option A (recommended: use host Docker daemon)

  • Mount the host Docker socket. You can drop privileged if not needed.
 services:
   hosty:
     build: .
-    privileged: true
     volumes:
       - .:/app
+      - /var/run/docker.sock:/var/run/docker.sock
     working_dir: /app

Option B (DinD: run a daemon inside the container)

  • Keep privileged, and start dockerd. One simple approach is to switch to the upstream DinD image, but if you keep this Dockerfile, add a command/entrypoint to start dockerd:
 services:
   hosty:
     build: .
     privileged: true
     volumes:
       - .:/app
     working_dir: /app
+    command: sh -lc 'dockerd > /var/log/dockerd.log 2>&1 & sleep 2 && tail -f /dev/null'

Note: If you go with Option A, you can simplify your Dockerfile by removing DinD packages to reduce image size.

🤖 Prompt for AI Agents
In compose.yaml around lines 3-7 the container installs Docker tooling but
neither mounts the host Docker socket nor runs a Docker daemon, so docker CLI
will fail at runtime; fix by choosing one option: Option A (recommended) — mount
the host socket into the service (add -
/var/run/docker.sock:/var/run/docker.sock) and remove privileged if unnecessary,
and optionally remove DinD packages from the image to shrink it; Option B (DinD)
— keep privileged, switch the service to run a daemon (use the official
docker:dind image or modify the Dockerfile/entrypoint to start dockerd on
container start), ensure any necessary volumes for docker data are declared, and
keep privileged only if you run dockerd.

15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
],
"scripts": {
"build": "tsc -p tsconfig.build.json",
"test": "node --import tsx test.ts"
"test": "rm -rf .tests/* && docker builder prune -f -a && node --import tsx test.ts",
"ci:test": "NODE_ENV=ci node --import tsx test.ts"
},
"repository": {
"type": "git",
Expand All @@ -30,13 +31,13 @@
},
"homepage": "https://github.com/webNeat/hosty",
"devDependencies": {
"@types/node": "^20.16.5",
"prettier": "^3.2.5",
"tsx": "^4.10.5",
"typescript": "^5.4.5",
"zx": "^8.1.4"
"@types/node": "^24.3.0",
"prettier": "^3.6.2",
"tsx": "^4.20.4",
"typescript": "^5.9.2",
"zx": "^8.8.0"
},
"dependencies": {
"yaml": "^2.4.5"
"yaml": "^2.8.1"
}
}
Loading
Loading