Added initial caddy app

This commit is contained in:
b0xxer
2024-02-19 10:51:38 -06:00
parent c6d2270cfa
commit 81485f1685
6 changed files with 80 additions and 2 deletions
+32
View File
@@ -0,0 +1,32 @@
- name: Create containers/caddy dir
ansible.builtin.file:
path: ~/containers/caddy
state: directory
- name: Create ~/vol/caddy dir
ansible.builtin.file:
path: ~/vol/caddy
state: directory
- name: Copy Containerfile
ansible.builtin.template:
path: caddy/Containerfile.j2
dest: ~/containers/caddy/Containerfile
- name: Copy caddy-node.container
ansible.builtin.template:
path: caddy/caddy-node.container.j2
dest: ~/containers/caddy/caddy-node.container
- name: Copy build.sh
ansible.builtin.template:
path: caddy/build.sh.j2
dest: ~/containers/caddy/build.sh
- name: Link caddy-node to .config/containers/systemd
ansible.builtin.file:
src: ~/conttainers/caddy/caddy-node.container
dest: ~/.config/containers/systemd/caddy-node.container
state: link
force: true
@@ -0,0 +1,20 @@
FROM docker.io/almalinux/9-minimal:latest AS builder
ARG VERSION={{caddy_version}}
WORKDIR /app
RUN dnf update -y \
&& dnf install -y wget tar gzip \
&& wget https://github.com/caddyserver/caddy/releases/download/v2.7.6/caddy_${VERSION}_linux_amd64.tar.gz \
&& wget https://github.com/caddyserver/caddy/releases/download/v2.7.6/caddy_${VERSION}_checksums.txt \
&& sha512sum --ignore-missing --check caddy_${VERSION}_checksums.txt \
&& tar xf caddy_${VERSION}_linux_amd64.tar.gz \
&& rm -f caddy_${VERSION}_linux.amd64.tar.gz LICENSE README.md caddy_${VERSION}_checksums.txt \
&& rm -rf /var/cache/* /var/log* /tmp/*
RUN chmod +x ./caddy
EXPOSE 8080 8443
ENTRYPOINT ["/app/caddy run --config /app/data/caddy.json"]
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
#Build command to make container
buildah build -t caddy:{{ caddy_version }} --build-arg VERSION={{ caddy_version }} -f Containerfile
@@ -0,0 +1,22 @@
[Unit]
Description=Caddy Node
[Container]
# Use the centos image
Image={{ registry_url }}/caddy:{{ caddy_version }}
#Environment=RPCAUTH={{ bitcoin_rpcauth }}
# Use volume
Volume=/home/{{ansible_user}}/vol/caddy:/data:Z
[Service]
# Restart service when sleep finishes
Restart=always
# Extend Timeout to allow time to pull the image
TimeoutStartSec=900
# ExecStartPre flag and other systemd commands can go here, see systemd.unit(5) man page.
# ExecStartPre=/usr/share/mincontainer/setup.sh
[Install]
# Start by default on boot
WantedBy=multi-user.target default.target
-1
View File
@@ -44,7 +44,6 @@
- zerotier-one
- python3-pip
- smartmontools
- caddy
tags: install
- name: Install local tools