From 1fcde8cea7f63f3d690d3218d780070a51f76aa4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Oct 2024 02:34:13 +0300 Subject: [PATCH] add compose file for linked networks and build arg to Dockerfile for ssl cert --- .dockerignore | 4 ++++ .env | 1 + Dockerfile | 4 +++- README.md | 4 ++-- docker-compose.linked.yml | 21 +++++++++++++++++++++ docker-compose.yml | 11 +++++++++++ 6 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 .dockerignore create mode 120000 .env create mode 100644 docker-compose.linked.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6d66cf8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +include.conf +config.env.example +README.md +docker-compose.yml diff --git a/.env b/.env new file mode 120000 index 0000000..bc48267 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +config.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9248dda..d777ff1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:latest +ARG BUILD_SERVER_NAME="irc.lame-network.local" + ENV ADMIN_EMAIL="no-reply@lame-netwoork.local" ENV SID="01A" @@ -215,7 +217,7 @@ RUN touch /etc/inspircd/oper.motd.txt RUN openssl genrsa -out /etc/ssl/inspircd/server.key RUN openssl req -new -key /etc/ssl/inspircd/server.key -out /etc/ssl/inspircd/server.csr \ - -subj "/C=US/ST=Washington/L=Seattle/O=LameNetwork/OU=IT Department/CN=lame-network.local" + -subj "/C=US/ST=Washington/L=Seattle/O=LameNetwork/OU=IT Department/CN=$SERVER_NAME" RUN openssl x509 -req -days 365 -in /etc/ssl/inspircd/server.csr -signkey /etc/ssl/inspircd/server.key -out /etc/ssl/inspircd/server.crt diff --git a/README.md b/README.md index e9241fa..bbfc025 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Instructions - `docker build -t inspi4 -t inspi4:latest .` -- `docker run -it --rm -e 'DEFAULT_BLOCK_HOST_MASK=""' -net host inspi4` +- `docker run -it --rm -e 'DEFAULT_BLOCK_HOST_MASK="nothing"' -net host inspi4` # Optional - create a custom `links.conf` -- `docker run -it --rm -e 'DEFAULT_BLOCK_HOST_MASK=""' -net host -v $(pwd)/links.conf:/etc/inspircd/links.conf:ro inspi4` +- `docker run -it --rm -e 'DEFAULT_BLOCK_HOST_MASK="nothing"' -net host -v $(pwd)/links.conf:/etc/inspircd/links.conf:ro inspi4` diff --git a/docker-compose.linked.yml b/docker-compose.linked.yml new file mode 100644 index 0000000..21065b7 --- /dev/null +++ b/docker-compose.linked.yml @@ -0,0 +1,21 @@ +services: + ircd_linked: + build: + context: . + args: + BUILD_SERVER_NAME: ${SERVER_NAME} + image: inspi4 + network_mode: "host" + env_file: "config.env" + volumes: + - ./links.conf:/etc/inspircd/links.conf:ro + - ssl:/etc/ssl/inspircd + - data:/var/lib/inspircd + - log:/var/log/inspircd +volumes: + data: + name: data + ssl: + name: ssl + log: + name: log diff --git a/docker-compose.yml b/docker-compose.yml index 82d420a..d081af1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,3 +3,14 @@ services: build: . network_mode: "host" env_file: "config.env" + volumes: + - ssl:/etc/ssl/inspircd + - data:/var/lib/inspircd + - log:/var/log/inspircd +volumes: + data: + name: data + ssl: + name: ssl + log: + name: log