-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
47 lines (38 loc) · 1.52 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM alpine:3.20
LABEL org.opencontainers.image.authors="Anope Team <[email protected]>"
ARG VERSION=2.0
ARG RUN_DEPENDENCIES="gnutls gnutls-utils mariadb-client mariadb-connector-c sqlite-libs"
ARG BUILD_DEPENDENCIES="gnutls-dev mariadb-dev sqlite-dev"
ARG EXTRA_MODULES="m_mysql m_sqlite m_ssl_gnutls"
RUN apk add --no-cache --virtual .build-utils gcc g++ ninja git cmake $BUILD_DEPENDENCIES && \
apk add --no-cache --virtual .dependencies libgcc libstdc++ $RUN_DEPENDENCIES && \
# Create a user to run anope later
adduser -u 10000 -h /anope/ -D -S anope && \
mkdir -p /src && \
cd /src && \
# Clone the requested version
git clone --depth 1 https://github.com/anope/anope.git anope -b $VERSION && \
cd /src/anope && \
# Add and overwrite modules
for module in $EXTRA_MODULES; do ln -s /src/anope/modules/extra/$module.cpp modules; done && \
mkdir build && \
cd /src/anope/build && \
cmake -DINSTDIR=/anope/ -DDEFUMASK=077 -DCMAKE_BUILD_TYPE=RELEASE -GNinja .. && \
# Run build multi-threaded
ninja install && \
# Uninstall all unnecessary tools after build process
apk del .build-utils && \
rm -rf /src && \
# Provide a data location
mkdir -p /data && \
touch /data/anope.db && \
ln -s /data/anope.db /anope/data/anope.db && \
# Make sure everything is owned by anope
chown -R anope /anope/ && \
chown -R anope /data/
COPY ./conf/ /anope/conf/
RUN chown -R anope /anope/conf/
WORKDIR /anope/
VOLUME /data/
USER anope
CMD ["/anope/bin/services", "-n"]