]> arthur.barton.de Git - ngircd-alex.git/blob - contrib/Dockerfile
ngIRCd Release 27
[ngircd-alex.git] / contrib / Dockerfile
1 # ngIRCd -- The Next Generation IRC Daemon
2 # Copyright (c)2001-2024 Alexander Barton (alex@barton.de) and Contributors
3
4 # Build Container
5
6 FROM docker.io/library/debian:stable-slim AS build
7 USER root
8 RUN apt-get -y update \
9         && apt-get -y install --no-install-recommends \
10                 autoconf \
11                 automake \
12                 build-essential \
13                 expect \
14                 gawk \
15                 git \
16                 libgnutls28-dev \
17                 libident-dev \
18                 libpam0g-dev \
19                 openssl \
20                 pkg-config \
21                 telnet \
22                 zlib1g-dev \
23         && mkdir -p /usr/local/src/ngircd /opt/ngircd \
24         && chown bin:bin /usr/local/src/ngircd /opt/ngircd
25 WORKDIR /usr/local/src/ngircd
26 COPY . /usr/local/src/ngircd
27 RUN chown -R bin /usr/local/src/ngircd
28 USER bin
29 RUN ./autogen.sh --prefix=/opt/ngircd \
30                 --with-gnutls \
31                 --with-iconv \
32                 --with-ident \
33                 --with-pam \
34         && make all \
35         && make -C src/ngircd check \
36         && make install \
37         && printf \
38                 "# ngircd.conf\n\n[Global]\nServerGID=irc\nServerUID=irc\n\n[Options]\nIdent=no\nPAM=no\n\n[SSL]\nCAFile=/etc/ssl/certs/ca-certificates.crt\n" \
39                 >/opt/ngircd/etc/ngircd.conf \
40         && chmod -R a+rX /opt/ngircd
41
42 # Run container
43
44 FROM docker.io/library/debian:stable-slim
45 USER root
46 RUN apt-get -y update \
47         && apt-get -y install --no-install-recommends --no-install-suggests \
48                 ca-certificates \
49                 catatonit \
50                 libgnutls30 \
51                 libident \
52                 libpam0g \
53                 libwrap0 \
54                 zlib1g \
55         && apt-get -y clean \
56         && rm -rf /var/cache/debconf/*-old /var/lib/apt/lists/*
57 COPY --from=build /opt/ngircd /opt/ngircd
58 USER irc
59 ENTRYPOINT [ "/usr/bin/catatonit", "--", "/opt/ngircd/sbin/ngircd", "--nodaemon" ]
60 EXPOSE 6667 6697
61 HEALTHCHECK --interval=30s --timeout=5s --retries=1 --start-period=5s \
62         CMD [ "/usr/bin/grep", "-F", ":1A0B ", "/proc/net/tcp" ]