From c87d46c06cf910b4cd3f13c7859ed1ecfb1ec29c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Oct 2024 08:00:07 +0300 Subject: [PATCH] add docker-compose file for services --- services/.env | 1 + services/Dockerfile | 8 ++------ services/config.env.example | 1 + services/docker-compose.yml | 21 +++++++++++++++++++++ 4 files changed, 25 insertions(+), 6 deletions(-) create mode 120000 services/.env create mode 100644 services/config.env.example create mode 100644 services/docker-compose.yml diff --git a/services/.env b/services/.env new file mode 120000 index 0000000..bc48267 --- /dev/null +++ b/services/.env @@ -0,0 +1 @@ +config.env \ No newline at end of file diff --git a/services/Dockerfile b/services/Dockerfile index 4e8161a..bab0fbb 100644 --- a/services/Dockerfile +++ b/services/Dockerfile @@ -12,8 +12,6 @@ RUN useradd --system --shell /bin/bash atheme -g atheme WORKDIR /tmp -RUN apt -y install libperl-dev - RUN git clone https://github.com/atheme/atheme.git WORKDIR /tmp/atheme @@ -26,7 +24,7 @@ RUN make -j$(nproc) RUN make install -RUN mkdir -p /etc/atheme -p /etc/ssl/atheme -p /var/lib/atheme -p /var/log/atheme +RUN mkdir -p /etc/atheme -p /etc/ssl/atheme -p /var/log/atheme RUN mv /usr/local/etc /usr/local/etc_old @@ -43,7 +41,7 @@ RUN openssl req -new -key /etc/ssl/atheme/server.key -out /etc/ssl/atheme/server RUN openssl x509 -req -days 365 -in /etc/ssl/atheme/server.csr -signkey /etc/ssl/atheme/server.key -out /etc/ssl/atheme/server.crt -RUN chown -R atheme:atheme /etc/atheme /etc/ssl/atheme /var/log/atheme /var/lib/atheme +RUN chown -R atheme:atheme /etc/atheme /etc/ssl/atheme /var/log/atheme WORKDIR / @@ -55,8 +53,6 @@ VOLUME /etc/atheme VOLUME /etc/ssl/atheme -VOLUME /var/lib/atheme - VOLUME /var/log/atheme ENTRYPOINT ["/usr/local/bin/atheme-services", "-p", "/tmp/atheme.pid", "-n"] diff --git a/services/config.env.example b/services/config.env.example new file mode 100644 index 0000000..3321caf --- /dev/null +++ b/services/config.env.example @@ -0,0 +1 @@ +SERVER_NAME="services.lame-network.local" diff --git a/services/docker-compose.yml b/services/docker-compose.yml new file mode 100644 index 0000000..653ccf6 --- /dev/null +++ b/services/docker-compose.yml @@ -0,0 +1,21 @@ +services: + atheme: + build: + context: . + args: + BUILD_SERVER_NAME: ${SERVER_NAME} + image: atheme + network_mode: "host" + env_file: "config.env" + volumes: + - data:/etc/atheme + - ./include.conf:/etc/atheme/include.conf:ro + - ssl:/etc/ssl/atheme + - log:/var/log/atheme +volumes: + data: + name: atheme_data + ssl: + name: atheme_ssl + log: + name: atheme_log