Refactor Docker Compose configurations and add deployment workflows for cloud-pc and mini-pc services
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
name: Deploy cloud-pc
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'cloud-pc/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
- name: Deploy changed stacks
|
||||||
|
run: |
|
||||||
|
ssh -o StrictHostKeyChecking=no ${{ secrets.CLOUD-PC_USER }}@${{ secrets.CLOUD-PC_HOST }} << 'ENDSSH'
|
||||||
|
cd /opt/services
|
||||||
|
git pull
|
||||||
|
for dir in $(git diff --name-only HEAD~1 HEAD | grep '^cloud-pc/' | cut -d/ -f2 | sort -u); do
|
||||||
|
echo "==> Deploying $dir"
|
||||||
|
cd /opt/services/cloud-pc/$dir
|
||||||
|
if grep -qE '^[[:space:]]*build:' docker-compose.yml; then
|
||||||
|
docker compose up -d --build --remove-orphans
|
||||||
|
else
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d --remove-orphans
|
||||||
|
fi
|
||||||
|
cd /opt/services
|
||||||
|
done
|
||||||
|
ENDSSH
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
name: Deploy mini-pc
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'mini-pc/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
- name: Deploy changed stacks
|
||||||
|
run: |
|
||||||
|
ssh -o StrictHostKeyChecking=no ${{ secrets.MINI-PC_USER }}@${{ secrets.MINI-PC_HOST }} << 'ENDSSH'
|
||||||
|
cd /opt/services
|
||||||
|
git pull
|
||||||
|
for dir in $(git diff --name-only HEAD~1 HEAD | grep '^mini-pc/' | cut -d/ -f2 | sort -u); do
|
||||||
|
echo "==> Deploying $dir"
|
||||||
|
cd /opt/services/mini-pc/$dir
|
||||||
|
if grep -qE '^[[:space:]]*build:' docker-compose.yml; then
|
||||||
|
docker compose up -d --build --remove-orphans
|
||||||
|
else
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d --remove-orphans
|
||||||
|
fi
|
||||||
|
cd /opt/services
|
||||||
|
done
|
||||||
|
ENDSSH
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
name: Deploy ru-vps
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- 'ru-vps/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
- name: Deploy changed stacks
|
||||||
|
run: |
|
||||||
|
ssh -o StrictHostKeyChecking=no ${{ secrets.RU-VPS_USER }}@${{ secrets.RU-VPS_HOST }} << 'ENDSSH'
|
||||||
|
cd /opt/services
|
||||||
|
git pull
|
||||||
|
for dir in $(git diff --name-only HEAD~1 HEAD | grep '^ru-vps/' | cut -d/ -f2 | sort -u); do
|
||||||
|
echo "==> Deploying $dir"
|
||||||
|
cd /opt/services/ru-vps/$dir
|
||||||
|
if grep -qE '^[[:space:]]*build:' docker-compose.yml; then
|
||||||
|
docker compose up -d --build --remove-orphans
|
||||||
|
else
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d --remove-orphans
|
||||||
|
fi
|
||||||
|
cd /opt/services
|
||||||
|
done
|
||||||
|
ENDSSH
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.env
|
||||||
|
*.env
|
||||||
|
!*.env.example
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[defaults]
|
||||||
|
inventory = inventory/hosts.yml
|
||||||
|
|
||||||
|
[ssh_connection]
|
||||||
|
pipelining = true
|
||||||
|
ssh_args = -o ControlMaster=auto -o ControlPersist=60s
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
all:
|
||||||
|
vars:
|
||||||
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
|
ansible_user: ada
|
||||||
|
|
||||||
|
children:
|
||||||
|
servers:
|
||||||
|
hosts:
|
||||||
|
ru-vps:
|
||||||
|
ansible_host: vps
|
||||||
|
|
||||||
|
cloud-pc:
|
||||||
|
ansible_host: 10.122.62.51
|
||||||
|
# ansible_host: 192.168.1.5
|
||||||
|
ansible_ssh_common_args: '-J mini-pc'
|
||||||
|
expected_lan_ip: 192.168.1.5
|
||||||
|
storage_mounts:
|
||||||
|
- src: UUID=ae278333-4116-4225-9b95-595496fadd26
|
||||||
|
path: /opt/data
|
||||||
|
fstype: ext4
|
||||||
|
- src: UUID=940a9a4e-10cf-4380-9d22-a71549066561
|
||||||
|
path: /mnt/backup
|
||||||
|
fstype: ext4
|
||||||
|
- src: UUID=89024d30-1ab6-4b2e-b23b-62837455b24a
|
||||||
|
path: /opt/samba
|
||||||
|
fstype: ext4
|
||||||
|
|
||||||
|
mini-pc:
|
||||||
|
ansible_host: 10.122.62.95
|
||||||
|
ansible_ssh_common_args: '-J vps'
|
||||||
|
expected_lan_ip: 192.168.1.10
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
- name: Base server setup
|
||||||
|
hosts: servers
|
||||||
|
gather_facts: true
|
||||||
|
become: false
|
||||||
|
tasks:
|
||||||
|
- name: Ping hosts
|
||||||
|
ansible.builtin.ping:
|
||||||
|
|
||||||
|
- name: Check expected LAN IP
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- expected_lan_ip in ansible_all_ipv4_addresses
|
||||||
|
fail_msg: "{{ inventory_hostname }} must have {{ expected_lan_ip }}; found: {{ ansible_all_ipv4_addresses | join(', ') }}"
|
||||||
|
success_msg: "{{ inventory_hostname }} has {{ expected_lan_ip }}"
|
||||||
|
when: expected_lan_ip is defined
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Запускать один раз на новом сервере от имени root или пользователя с полным sudo:
|
||||||
|
# ansible-playbook -i inventory/hosts.yml playbooks/bootstrap.yml -K
|
||||||
|
#
|
||||||
|
# После выполнения: Ansible-плейбуки всё равно требуют -K (become),
|
||||||
|
# но деплой через GitOps (docker compose) работает без пароля.
|
||||||
|
- name: Bootstrap servers
|
||||||
|
hosts: servers
|
||||||
|
become: true
|
||||||
|
roles:
|
||||||
|
- bootstrap
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
- name: Directory structure — cloud-pc
|
||||||
|
hosts: cloud-pc
|
||||||
|
become: true
|
||||||
|
vars:
|
||||||
|
data_user: ada
|
||||||
|
data_group: ada
|
||||||
|
tasks:
|
||||||
|
- name: Create base mount points
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ data_user }}"
|
||||||
|
group: "{{ data_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop: "{{ storage_mounts | default([]) }}"
|
||||||
|
|
||||||
|
- name: Mount base storage disks
|
||||||
|
ansible.posix.mount:
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
fstype: "{{ item.fstype }}"
|
||||||
|
opts: "{{ item.opts | default('defaults,nofail') }}"
|
||||||
|
state: mounted
|
||||||
|
loop: "{{ storage_mounts | default([]) }}"
|
||||||
|
|
||||||
|
- name: Create service data and config directories
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ data_user }}"
|
||||||
|
group: "{{ data_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- /opt/data/postgres
|
||||||
|
- /opt/data/nextcloud
|
||||||
|
- /opt/data/gitea
|
||||||
|
- /opt/data/gitea-runner
|
||||||
|
- /opt/data/syncthing
|
||||||
|
- /opt/data/zerotier
|
||||||
|
- /opt/samba/media
|
||||||
|
- /opt/samba/documents
|
||||||
|
- /opt/samba/backups_win
|
||||||
|
- /opt/configs
|
||||||
|
- /opt/configs/nextcloud/app
|
||||||
|
- /opt/configs/syncthing
|
||||||
|
|
||||||
|
- name: Create /opt/services
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /opt/services
|
||||||
|
state: directory
|
||||||
|
owner: "{{ data_user }}"
|
||||||
|
group: "{{ data_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Create backup directories (3TB)
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ data_user }}"
|
||||||
|
group: "{{ data_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- /mnt/backup/restic/services
|
||||||
|
- /mnt/backup/restic/samba
|
||||||
|
- /mnt/backup/devices/proxmox
|
||||||
|
- /mnt/backup/devices/ada-x1
|
||||||
|
|
||||||
|
- name: Directory structure — mini-pc
|
||||||
|
hosts: mini-pc
|
||||||
|
become: true
|
||||||
|
vars:
|
||||||
|
data_user: ada
|
||||||
|
data_group: ada
|
||||||
|
tasks:
|
||||||
|
- name: Create service directories
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ data_user }}"
|
||||||
|
group: "{{ data_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- /opt/services
|
||||||
|
- /opt/data
|
||||||
|
- /opt/configs
|
||||||
|
- /opt/data/vaultwarden
|
||||||
|
- /opt/data/adguard/work
|
||||||
|
- /opt/data/caddy
|
||||||
|
- /opt/data/gitea-runner
|
||||||
|
- /opt/data/npm
|
||||||
|
- /opt/data/zerotier
|
||||||
|
- /opt/configs/adguard
|
||||||
|
- /opt/configs/caddy
|
||||||
|
- /opt/configs/npm/letsencrypt
|
||||||
|
|
||||||
|
- name: Directory structure — ru-vps
|
||||||
|
hosts: ru-vps
|
||||||
|
become: true
|
||||||
|
vars:
|
||||||
|
data_user: ada
|
||||||
|
data_group: ada
|
||||||
|
tasks:
|
||||||
|
- name: Create service directories
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ data_user }}"
|
||||||
|
group: "{{ data_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- /opt/services
|
||||||
|
- /opt/data
|
||||||
|
- /opt/configs
|
||||||
|
- /opt/data/caddy
|
||||||
|
- /opt/data/gitea-runner
|
||||||
|
- /opt/data/zerotier
|
||||||
|
- /opt/configs/caddy
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
bootstrap_user: ada
|
||||||
|
bootstrap_ssh_public_keys: [ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIWNsUQmppB6cQccXX1ZaBbFIcmM6RmghsTVbG9TgoZB ada@ada-x1]
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
- name: restart sshd
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: sshd
|
||||||
|
state: restarted
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
- name: Ensure user exists
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ bootstrap_user }}"
|
||||||
|
shell: /bin/bash
|
||||||
|
groups: sudo
|
||||||
|
append: true
|
||||||
|
create_home: true
|
||||||
|
state: present
|
||||||
|
|
||||||
|
# docker group создаётся только после установки Docker.
|
||||||
|
# Добавление происходит в роли docker, не здесь.
|
||||||
|
|
||||||
|
- name: Add SSH authorized keys
|
||||||
|
ansible.posix.authorized_key:
|
||||||
|
user: "{{ bootstrap_user }}"
|
||||||
|
key: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
loop: "{{ bootstrap_ssh_public_keys }}"
|
||||||
|
when: bootstrap_ssh_public_keys | length > 0
|
||||||
|
|
||||||
|
# Команды, которые реально нужны без пароля:
|
||||||
|
# apt / apt-get — обновление пакетов
|
||||||
|
# systemctl — управление сервисами
|
||||||
|
# ufw — фаервол
|
||||||
|
# resticprofile — установка systemd-таймеров бэкапа
|
||||||
|
#
|
||||||
|
# Ansible become НЕ входит в этот список намеренно:
|
||||||
|
# для плейбуков запускать с -K. Это сознательный компромисс
|
||||||
|
# между удобством и тем, чтобы не давать python3 NOPASSWD (= root).
|
||||||
|
- name: Configure sudoers — NOPASSWD for specific commands
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/sudoers.d/{{ bootstrap_user }}
|
||||||
|
content: |
|
||||||
|
{{ bootstrap_user }} ALL=(ALL) NOPASSWD: /usr/bin/apt, /usr/bin/apt-get
|
||||||
|
{{ bootstrap_user }} ALL=(ALL) NOPASSWD: /usr/bin/systemctl
|
||||||
|
{{ bootstrap_user }} ALL=(ALL) NOPASSWD: /usr/bin/ufw
|
||||||
|
{{ bootstrap_user }} ALL=(ALL) NOPASSWD: /usr/local/bin/resticprofile
|
||||||
|
validate: /usr/sbin/visudo -cf %s
|
||||||
|
mode: "0440"
|
||||||
|
|
||||||
|
# Drop-in конфиг — не трогаем основной sshd_config.
|
||||||
|
# Требует Debian 12+ (OpenSSH 8.9+).
|
||||||
|
- name: Harden SSH
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/ssh/sshd_config.d/99-hardening.conf
|
||||||
|
content: |
|
||||||
|
PasswordAuthentication no
|
||||||
|
PermitRootLogin no
|
||||||
|
PubkeyAuthentication yes
|
||||||
|
mode: "0644"
|
||||||
|
notify: restart sshd
|
||||||
|
|
||||||
|
- name: Ensure sshd_config.d is included
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
line: Include /etc/ssh/sshd_config.d/*.conf
|
||||||
|
state: present
|
||||||
|
insertbefore: BOF
|
||||||
|
validate: /usr/sbin/sshd -t -f %s
|
||||||
|
notify: restart sshd
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
services:
|
||||||
|
ada-dev:
|
||||||
|
image: git.ada-dev.ru/ada/ada-dev.ru:latest
|
||||||
|
container_name: ada-dev-ru
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "7080:80"
|
||||||
@@ -4,7 +4,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
- /srv/stacks/gitea-runner/data:/data
|
- /opt/data/gitea-runner:/data
|
||||||
environment:
|
environment:
|
||||||
GITEA_INSTANCE_URL: https://git.ada-dev.ru
|
GITEA_INSTANCE_URL: https://git.ada-dev.ru
|
||||||
GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN}
|
GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN}
|
||||||
|
|||||||
@@ -16,11 +16,8 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- type: bind
|
- type: bind
|
||||||
source: /srv/stacks/gitea/data
|
source: /opt/data/gitea
|
||||||
target: /data
|
target: /data
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
name: gitea_default
|
name: gitea_default
|
||||||
x-dockge:
|
|
||||||
urls:
|
|
||||||
- https://git.ada-dev.ru
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
services:
|
||||||
|
neural:
|
||||||
|
ports:
|
||||||
|
- 4567:4567
|
||||||
|
image: git.ada-dev.ru/ada/lr_miad_nn:latest
|
||||||
|
networks: {}
|
||||||
@@ -5,7 +5,7 @@ services:
|
|||||||
hostname: postgres
|
hostname: postgres
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /srv/stacks/postgresql/data:/var/lib/postgresql/data
|
- /opt/data/postgres:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
TZ: Europe/Moscow
|
TZ: Europe/Moscow
|
||||||
POSTGRES_DB: ${DB_NAME}
|
POSTGRES_DB: ${DB_NAME}
|
||||||
@@ -35,8 +35,8 @@ services:
|
|||||||
- postgres
|
- postgres
|
||||||
- redis
|
- redis
|
||||||
volumes:
|
volumes:
|
||||||
- /srv/stacks/nextcloud/nc_data:/var/www/html
|
- /opt/configs/nextcloud/app:/var/www/html
|
||||||
- /mnt/pool/nextcloud:/var/www/html/data
|
- /opt/data/nextcloud:/var/www/html/data
|
||||||
- /mnt/yandex:/mnt/yandex:shared
|
- /mnt/yandex:/mnt/yandex:shared
|
||||||
environment:
|
environment:
|
||||||
TZ: Europe/Moscow
|
TZ: Europe/Moscow
|
||||||
@@ -57,8 +57,8 @@ services:
|
|||||||
container_name: cron
|
container_name: cron
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /srv/stacks/nextcloud/nc_data:/var/www/html
|
- /opt/configs/nextcloud/app:/var/www/html
|
||||||
- /mnt/pool/nextcloud:/var/www/html/data
|
- /opt/data/nextcloud:/var/www/html/data
|
||||||
entrypoint: /cron.sh
|
entrypoint: /cron.sh
|
||||||
depends_on:
|
depends_on:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
version = "1"
|
||||||
|
|
||||||
|
[global]
|
||||||
|
scheduler = "systemd"
|
||||||
|
|
||||||
|
# ── Общие настройки ────────────────────────────────────────────────────────────
|
||||||
|
[default]
|
||||||
|
password-file = "/etc/restic/password"
|
||||||
|
initialize = true
|
||||||
|
|
||||||
|
[default.forget]
|
||||||
|
keep-daily = 7
|
||||||
|
keep-weekly = 4
|
||||||
|
keep-monthly = 6
|
||||||
|
schedule-permission = "system"
|
||||||
|
schedule-after-backup = true
|
||||||
|
prune = true
|
||||||
|
|
||||||
|
[default.check]
|
||||||
|
schedule = "Sun 04:00"
|
||||||
|
schedule-permission = "system"
|
||||||
|
|
||||||
|
# ── Данные и конфиги сервисов ─────────────────────────────────────────────────
|
||||||
|
[services]
|
||||||
|
inherit = "default"
|
||||||
|
repository = "/mnt/backup/restic/services"
|
||||||
|
|
||||||
|
[services.backup]
|
||||||
|
source = ["/opt/data", "/opt/configs"]
|
||||||
|
tag = ["cloud-pc", "services"]
|
||||||
|
exclude-caches = true
|
||||||
|
one-file-system = true
|
||||||
|
schedule = "02:00"
|
||||||
|
schedule-permission = "system"
|
||||||
|
schedule-log = "/var/log/resticprofile/services.log"
|
||||||
|
|
||||||
|
[services.forget]
|
||||||
|
schedule = "02:30"
|
||||||
|
|
||||||
|
# ── Samba-шара ────────────────────────────────────────────────────────────────
|
||||||
|
[samba]
|
||||||
|
inherit = "default"
|
||||||
|
repository = "/mnt/backup/restic/samba"
|
||||||
|
|
||||||
|
[samba.backup]
|
||||||
|
source = ["/opt/samba"]
|
||||||
|
tag = ["cloud-pc", "samba"]
|
||||||
|
exclude-caches = true
|
||||||
|
one-file-system = true
|
||||||
|
schedule = "03:00"
|
||||||
|
schedule-permission = "system"
|
||||||
|
schedule-log = "/var/log/resticprofile/samba.log"
|
||||||
|
|
||||||
|
[samba.forget]
|
||||||
|
schedule = "03:30"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
SAMBA_PASSWORD=changeme
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
services:
|
||||||
|
samba:
|
||||||
|
image: ghcr.io/servercontainers/samba:latest
|
||||||
|
container_name: samba
|
||||||
|
restart: unless-stopped
|
||||||
|
network_mode: host
|
||||||
|
volumes:
|
||||||
|
- /opt/samba/media:/shares/media
|
||||||
|
- /opt/samba/documents:/shares/documents
|
||||||
|
- /opt/samba/backups_win:/shares/backups_win
|
||||||
|
environment:
|
||||||
|
ACCOUNT_ada: ${SAMBA_PASSWORD}
|
||||||
|
UID_ada: "1000"
|
||||||
|
SAMBA_VOLUME_CONFIG_media: "[media]; path = /shares/media; valid users = ada; read only = no"
|
||||||
|
SAMBA_VOLUME_CONFIG_documents: "[documents]; path = /shares/documents; valid users = ada; read only = no"
|
||||||
|
SAMBA_VOLUME_CONFIG_backups_win: "[backups_win]; path = /shares/backups_win; valid users = ada; read only = no"
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
services:
|
||||||
|
syncthing:
|
||||||
|
image: syncthing/syncthing:latest
|
||||||
|
container_name: syncthing
|
||||||
|
hostname: cloud-pc
|
||||||
|
environment:
|
||||||
|
PUID: "1000"
|
||||||
|
PGID: "1000"
|
||||||
|
STGUIADDRESS: 0.0.0.0:8384
|
||||||
|
volumes:
|
||||||
|
- /opt/configs/syncthing:/var/syncthing/config
|
||||||
|
- /opt/data/syncthing:/var/syncthing/data
|
||||||
|
network_mode: host
|
||||||
|
restart: unless-stopped
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
services:
|
||||||
|
watchtower:
|
||||||
|
image: containrrr/watchtower:latest
|
||||||
|
environment:
|
||||||
|
- DOCKER_API_VERSION=1.54
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
command: --interval 300 --cleanup
|
||||||
|
restart: unless-stopped
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
services:
|
||||||
|
zerotier:
|
||||||
|
container_name: zerotier
|
||||||
|
restart: unless-stopped
|
||||||
|
network_mode: host
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- SYS_ADMIN
|
||||||
|
devices:
|
||||||
|
- /dev/net/tun
|
||||||
|
volumes:
|
||||||
|
- /opt/data/zerotier:/var/lib/zerotier-one
|
||||||
|
image: zerotier/zerotier:latest
|
||||||
|
command: ["743993800fa5a34c"]
|
||||||
|
networks: {}
|
||||||
@@ -23,8 +23,8 @@ services:
|
|||||||
- PGID=1000
|
- PGID=1000
|
||||||
- TZ=Europe/Moscow
|
- TZ=Europe/Moscow
|
||||||
volumes:
|
volumes:
|
||||||
- /srv/stacks/adguard/work:/opt/adguardhome/work:rw
|
- /opt/data/adguard/work:/opt/adguardhome/work:rw
|
||||||
- /srv/stacks/adguard/conf:/opt/adguardhome/conf:rw
|
- /opt/configs/adguard:/opt/adguardhome/conf:rw
|
||||||
- /etc/hosts:/etc/hosts:ro
|
- /etc/hosts:/etc/hosts:ro
|
||||||
ports:
|
ports:
|
||||||
- 53:53/tcp # DNS - **mandatory**
|
- 53:53/tcp # DNS - **mandatory**
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
TIMEWEB_API_URL=https://api.timeweb.cloud/api/v1
|
||||||
|
TIMEWEB_API_TOKEN=changeme
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
acme_dns timeweb {
|
||||||
|
ApiURL {env.TIMEWEB_API_URL}
|
||||||
|
ApiToken {env.TIMEWEB_API_TOKEN}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
git.ada-dev.ru {
|
||||||
|
reverse_proxy 192.168.1.5:3002
|
||||||
|
}
|
||||||
|
|
||||||
|
cloud.ada-dev.ru {
|
||||||
|
reverse_proxy 192.168.1.5:8081
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
FROM caddy:2-builder-alpine AS builder
|
||||||
|
|
||||||
|
RUN xcaddy build \
|
||||||
|
--with github.com/dmtr636/caddy-dns-timeweb@v1.0.3
|
||||||
|
|
||||||
|
FROM caddy:2-alpine
|
||||||
|
|
||||||
|
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
services:
|
||||||
|
caddy:
|
||||||
|
build: .
|
||||||
|
container_name: caddy
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
- "443:443/udp"
|
||||||
|
volumes:
|
||||||
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||||
|
- /opt/data/caddy:/data
|
||||||
|
- /opt/configs/caddy:/config
|
||||||
|
networks: {}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
services:
|
||||||
|
gitea-runner:
|
||||||
|
image: gitea/act_runner:latest
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- /opt/data/gitea-runner:/data
|
||||||
|
environment:
|
||||||
|
GITEA_INSTANCE_URL: https://git.ada-dev.ru
|
||||||
|
GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN}
|
||||||
|
GITEA_RUNNER_NAME: mini-pc-runner
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
services:
|
|
||||||
npm:
|
|
||||||
image: jc21/nginx-proxy-manager:latest
|
|
||||||
container_name: npm
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
- "81:81" # UI
|
|
||||||
volumes:
|
|
||||||
- /srv/stacks/npm/data:/data
|
|
||||||
- /srv/stacks/npm/letsencrypt:/etc/letsencrypt
|
|
||||||
@@ -10,7 +10,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- type: bind
|
- type: bind
|
||||||
source: /srv/stacks/vaultwarden/data
|
source: /opt/data/vaultwarden
|
||||||
target: /data
|
target: /data
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
services:
|
||||||
|
zerotier:
|
||||||
|
container_name: zerotier
|
||||||
|
restart: unless-stopped
|
||||||
|
network_mode: host
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- SYS_ADMIN
|
||||||
|
devices:
|
||||||
|
- /dev/net/tun
|
||||||
|
volumes:
|
||||||
|
- /opt/data/zerotier:/var/lib/zerotier-one
|
||||||
|
image: zerotier/zerotier:latest
|
||||||
|
command: ["743993800fa5a34c"]
|
||||||
|
networks: {}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
ada-dev.ru {
|
||||||
|
reverse_proxy 10.122.62.51:7080
|
||||||
|
}
|
||||||
|
|
||||||
|
cloud.ada-dev.ru {
|
||||||
|
reverse_proxy 10.122.62.51:8081
|
||||||
|
}
|
||||||
|
|
||||||
|
git.ada-dev.ru {
|
||||||
|
reverse_proxy 10.122.62.51:3002
|
||||||
|
}
|
||||||
|
|
||||||
|
pass.ada-dev.ru {
|
||||||
|
reverse_proxy 10.122.62.95:10380
|
||||||
|
}
|
||||||
|
|
||||||
|
# projects.ada-dev.ru {
|
||||||
|
# reverse_proxy 10.122.62.51:4567
|
||||||
|
# }
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
services:
|
||||||
|
caddy:
|
||||||
|
image: caddy:2-alpine
|
||||||
|
container_name: caddy
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
- "443:443/udp"
|
||||||
|
volumes:
|
||||||
|
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||||
|
- /opt/data/caddy:/data
|
||||||
|
- /opt/configs/caddy:/config
|
||||||
|
networks: {}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
services:
|
||||||
|
gitea-runner:
|
||||||
|
image: gitea/act_runner:latest
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
- /opt/data/gitea-runner:/data
|
||||||
|
environment:
|
||||||
|
GITEA_INSTANCE_URL: https://git.ada-dev.ru
|
||||||
|
GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN}
|
||||||
|
GITEA_RUNNER_NAME: ru-vps-runner
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
services:
|
||||||
|
zerotier:
|
||||||
|
container_name: zerotier
|
||||||
|
restart: unless-stopped
|
||||||
|
network_mode: host
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- SYS_ADMIN
|
||||||
|
devices:
|
||||||
|
- /dev/net/tun
|
||||||
|
volumes:
|
||||||
|
- /opt/data/zerotier:/var/lib/zerotier-one
|
||||||
|
image: zerotier/zerotier:latest
|
||||||
|
command: ["743993800fa5a34c"]
|
||||||
|
networks: {}
|
||||||
Reference in New Issue
Block a user