use docker compose instead

This commit is contained in:
2026-05-13 14:08:41 -04:00
parent 89952369f0
commit 1ca802dc2a
9 changed files with 55 additions and 42 deletions
+7 -2
View File
@@ -1,3 +1,8 @@
Before using this playbook, the target hosts must have: Before using this playbook, the target hosts must have:
- Public key of control node in ~/.ssh/id_rsa.pub - Public key of control node in ~/.ssh/authorized_keys
- Passwordless sudo enabled (see: <https://spinupwp.com/doc/passwordless-sudo/>) - Passwordless sudo enabled (see: <https://spinupwp.com/doc/passwordless-sudo/>)
- Docker installed
- Add user to docker group
On this local machine:
- Create docker context for the remote host
+4
View File
@@ -6,4 +6,8 @@ test1.tingker.ddns.net {
test2.tingker.ddns.net { test2.tingker.ddns.net {
file_server file_server
root * /var/www/html/test2 root * /var/www/html/test2
}
git.tingker.ddns.net {
reverse_proxy gitea:3000
} }
View File
View File
+41
View File
@@ -0,0 +1,41 @@
volumes:
postgres:
driver: local
gitea:
driver: local
services:
caddy:
image: caddy:2-alpine
ports:
- 80:80
- 443:443
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
- ./caddy/test1.html:/var/www/html/test1/index.html
- ./caddy/test2.html:/var/www/html/test2/index.html
postgres:
image: postgres:18-alpine
environment:
POSTGRES_PASSWORD: postgres
volumes:
- postgres:/var/lib/postgresql/18/docker
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
gitea:
image: docker.gitea.com/gitea:1.26.1
environment:
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=postgres
- GITEA__database__NAME=giteadb
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=gitea
depends_on:
- postgres
volumes:
- gitea:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "2222:22"
-3
View File
@@ -1,3 +0,0 @@
homelab:
hosts:
rosebook.local:
-2
View File
@@ -1,2 +0,0 @@
[tools]
python = "3"
-35
View File
@@ -1,35 +0,0 @@
- name: Caddy
hosts: rosebook.local
become: true
tasks:
- name: Install Caddy
ansible.builtin.apt:
name: caddy
state: present
- name: Create Caddyfile
ansible.builtin.copy:
dest: /etc/caddy/Caddyfile
src: Caddyfile
- name: Web directory
ansible.builtin.file:
path: /var/www/html/test1
state: directory
mode: '0755'
- name: Web directory
ansible.builtin.file:
path: /var/www/html/test2
state: directory
mode: '0755'
- name: Static website
ansible.builtin.copy:
dest: /var/www/html/test1/index.html
src: test1.html
- name: Static website
ansible.builtin.copy:
dest: /var/www/html/test2/index.html
src: test2.html
- name: Enable and start service
ansible.builtin.service:
name: caddy
enabled: true
state: restarted
+3
View File
@@ -0,0 +1,3 @@
CREATE ROLE gitea WITH LOGIN PASSWORD 'gitea';
CREATE DATABASE giteadb WITH OWNER gitea TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
GRANT ALL PRIVILEGES ON DATABASE giteadb TO gitea;