This commit is contained in:
Joshua Perry 2024-11-20 23:52:36 +00:00
commit b3995fc12b
4 changed files with 109 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.env
.radicle/

30
docker-compose.yml Normal file
View File

@ -0,0 +1,30 @@
services:
seed:
build:
context: .
dockerfile: seed.Dockerfile
args:
RAD_ALIAS: ${RAD_ALIAS}
RAD_PASSPHRASE: ${RAD_PASSPHRASE}
RAD_VERSION: ${SEED_VERSION}
RAD_ARCH: ${RAD_ARCH}
RAD_OS: ${RAD_OS}
ports:
- ${SEED_PORT}:8776
volumes:
- ${VOLUME_DIR}:/home/root/.radicle/
httpd:
build:
context: .
dockerfile: httpd.Dockerfile
args:
RAD_VERSION: ${DAEMON_VERSION}
RAD_ARCH: ${RAD_ARCH}
RAD_OS: ${RAD_OS}
depends_on:
- seed
ports:
- ${DAEMON_PORT}:8080
volumes:
- ${VOLUME_DIR}:/home/root/.radicle/

33
httpd.Dockerfile Normal file
View File

@ -0,0 +1,33 @@
# Minimal Debian
FROM debian:bookworm-slim
# Build Variables
ARG RAD_VERSION
ARG RAD_ARCH
ARG RAD_OS
# Environment Variables
ENV PATH=$PATH:/usr/local/bin
ENV RAD_HOME=/home/root/.radicle
ENV RAD_TARGET=radicle-httpd-$RAD_VERSION-$RAD_ARCH-$RAD_OS.tar.xz
# System Update
RUN apt update && apt upgrade -y
# Install Dependants
RUN apt install -y \
curl \
ca-certificates \
git \
tar \
xz-utils
# Install WebView
RUN curl -O -L https://files.radicle.xyz/releases/radicle-httpd/latest/$RAD_TARGET \
&& tar -xvJf $RAD_TARGET --strip-components=1 -C /usr/local
# Clean Up
RUN apt clean \
&& rm -r /var/lib/apt/lists/* $RAD_TARGET
CMD ["radicle-httpd"]

44
seed.Dockerfile Normal file
View File

@ -0,0 +1,44 @@
# Minimal Debian
FROM debian:bookworm-slim
# Build Variables
ARG RAD_VERSION
ARG RAD_ARCH
ARG RAD_OS
ARG RAD_ALIAS
ARG RAD_PASSPHRASE
# Environment Variables
ENV PATH=$PATH:/usr/local/bin
ENV RAD_HOME=/home/root/.radicle
ENV RAD_TARGET=radicle-$RAD_VERSION-$RAD_ARCH-$RAD_OS.tar.xz
ENV RAD_PASSPHRASE=$RAD_PASSPHRASE
ENV RAD_ALIAS=$RAD_ALIAS
# Prepare Home
RUN mkdir -p $RAD_HOME
# System Update
RUN apt update && apt upgrade -y
# Install Dependants
RUN apt install -y \
curl \
ca-certificates \
git \
jq \
tar \
xz-utils
# Install Radicle
RUN curl -L -O https://files.radicle.xyz/releases/latest/$RAD_TARGET \
&& tar -xvJf $RAD_TARGET --strip-components=1 -C /usr/local
# Clean Up
RUN apt clean \
&& rm -r /var/lib/apt/lists/* $RAD_TARGET
#Set Default Policy
RUN jq '.node.seedPolicy.default = "block"'
ENTRYPOINT ["sh", "-c","rad auth --alias $RAD_ALIAS && rad node start --foreground"]