Browse Source

Initial docker-compose file for easy setup with InspIRCd

- We now have a docker-compose.yml, which will automatically provision
  an InspIRCd docker container alongside an sms-irc one and handle all
  the linking for you, such that you only have to give it a postgres
  database, deal with its files, and you can connect to an IRC port!
- However, some work could still be done to document it a bit better.
master
η (eta) 2 years ago
parent
commit
91f07ba308
  1. 7
      Dockerfile
  2. 22
      docker-compose.yml
  3. 14
      docker/compose-config.toml
  4. 7
      docker/compose.sh
  5. 10
      docker/inspircd.env

7
Dockerfile

@ -2,7 +2,7 @@ FROM archlinux/base:latest AS sms-irc-compiled
# update OS
RUN pacman -Syu --noconfirm
RUN pacman -S --needed --noconfirm base-devel
RUN pacman -S --needed --noconfirm base-devel postgresql-libs
# install Rust: download rustup
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
@ -27,8 +27,8 @@ RUN /bin/bash -c 'rm -rf src'
# add the actual code
ADD ./src /sms-irc/src
# add some dependencies
RUN pacman -S --noconfirm postgresql-libs
# add migrations and other stuff
ADD ./migrations /sms-irc/migrations
# build it!
RUN ~/.cargo/bin/cargo build --release
@ -37,4 +37,5 @@ WORKDIR /sms-irc
RUN apt-get update && apt-get install -y libssl1.1 ca-certificates libpq5
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=sms-irc-compiled /sms-irc/target/release/sms-irc /sms-irc
ADD ./docker /sms-irc/docker
ENTRYPOINT "/sms-irc/sms-irc"

22
docker-compose.yml

@ -0,0 +1,22 @@
version: "3.2"
services:
inspircd:
image: "inspircd/inspircd-docker"
env_file: "docker/inspircd.env"
expose:
- "7000"
ports:
- "${SMS_PORT}:6667"
sms-irc:
image: "eeeeeta/sms-irc"
entrypoint: "/sms-irc/docker/compose.sh"
environment:
SMS_ADMIN_NICK:
SMS_DL_PATH:
SMS_DATABASE_URL:
volumes:
- type: "mount"
source: "${SMS_ATTACH_PATH}"
target: "/data"
depends_on:
- inspircd

14
docker/compose-config.toml

@ -0,0 +1,14 @@
insp_s2s.sid = "42A"
insp_s2s.control_nick = "sms-irc"
insp_s2s.sendpass = "smslink"
insp_s2s.recvpass = "smslink"
insp_s2s.server_desc = "sms-irc bridge in Docker Compose"
insp_s2s.server_name = "sms-irc."
insp_s2s.log_chan = "#smsirc"
insp_s2s.hostname = "inspircd"
insp_s2s.port = 7000
insp_s2s.set_topics = true
insp_s2s.clobber_topics = true
insp_s2s.ensure_joined = true
whatsapp.media_path = "/data"
whatsapp.autocreate_prefix = "#wa"

7
docker/compose.sh

@ -0,0 +1,7 @@
#!/bin/bash
echo "database_url = \"$SMS_DATABASE_URL\"" > /sms-irc/config.toml
echo "insp_s2s.admin_nick = \"$SMS_ADMIN_NICK\"" >> /sms-irc/config.toml
echo "whatsapp.dl_path = \"$SMS_DL_PATH\"" >> /sms-irc/config.toml
cat /sms-irc/docker/compose-config.toml >> /sms-irc/config.toml
/sms-irc/sms-irc

10
docker/inspircd.env

@ -0,0 +1,10 @@
INSP_NET_SUFFIX=.sms-irc.
INSP_NET_NAME=sms-irc
INSP_ENABLE_DNSBL=no
INSP_OPER_PASSWORD_HASH=HSzCE8EC$rqwMKkihduYsg8Yr6q3m6FfwtRswKwRL4X54zdWMf5s
INSP_OPER_SSLONLY=no
INSP_SERVICES_NAME=sms-irc.
INSP_SERVICES_IPADDR=sms-irc
INSP_SERVICES_TLS_ON=no
INSP_SERVICES_PASSWORD=smslink
Loading…
Cancel
Save