-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
90 lines (74 loc) · 2.84 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
FROM ubuntu:16.04
# Get hlstatsxce perl daemon scripts and set permissions
RUN apt-get update && apt-get install git -y \
&& git clone https://bitbucket.org/Maverick_of_UC/hlstatsx-community-edition.git /hlstatsx-community-edition \
&& cd /hlstatsx-community-edition \
&& git checkout 11cac08de8c01b7a07897562596e59b7f0f86230 \
&& mv /hlstatsx-community-edition/scripts /app \
&& find /app -type d -exec chmod 750 {} \; \
&& find /app -type f -exec chmod 640 {} \; \
&& find /app -type f -name '*.sh' -exec chmod 750 {} \; \
&& find /app -type f -name '*.pl' -exec chmod 750 {} \; \
&& find /app -type f -name 'run_*' -exec chmod 750 {} \; \
&& rm -rf /hlstatsx-community-edition \
&& apt-get purge --auto-remove -y git \
&& rm -rf /var/lib/apt/lists/*
# Download the GeoIP binary. Maxmind discontinued distributing the GeoLite Legacy databases. See: https://support.maxmind.com/geolite-legacy-discontinuation-notice/
# So let's download it from our fork of GeoLiteCity.dat
RUN apt-get update && apt-get install -y ca-certificates wget \
&& rm -rf /var/lib/apt/lists/* \
&& cd /app/GeoLiteCity \
&& wget -qO- https://github.com/startersclan/GeoLiteCity-data/raw/c14d99c42446f586e3ca9c89fe13714474921d65/GeoLiteCity.dat > GeoLiteCity.dat \
&& chmod 666 GeoLiteCity.dat \
&& ls -l
#
# Export these environment variables
#
# MCPAN non-interactive (silent). It makes perl automatically answer "yes" when CPAN asks "Would you like to configure as much as possible automatically? [yes]"
# Same as using:
# export PERL_MM_USE_DEFAULT=1
ENV PERL_MM_USE_DEFAULT 1
# Perl module installation location
# Enable line(s) if entrypoint throws errors about missing modules in @INC
# Same as using:
# export PERL_MM_OPT=/usr/share/perl5
# export PERL_MB_OPT=/usr/share/perl5
#ENV PERL_MM_OPT /usr/share/perl5
#ENV PERL_MB_OPT /usr/share/perl5
# Perl @INC location
# Enable line(s) if entrypoint throws errors about missing modules in @INC
# Same as using:
# export PERL5LIB=/usr/share/perl5
#ENV PERL5LIB /usr/share/perl5
# Install perl
RUN apt-get update \
&& apt-get install -y \
perl \
&& rm -rf /var/lib/apt/lists/*
#
# Perl modules
#
# Install DB perl modules through packages
RUN apt-get update \
&& apt-get install -y \
libdbi-perl \
libdbd-mysql-perl \
&& rm -rf /var/lib/apt/lists/*
# Install modules for perl GeoIP
RUN apt-get update \
&& apt-get install -y \
build-essential \
cpanminus \
&& cpanm \
Geo::IP::PurePerl \
&& apt-get purge --auto-remove -y \
build-essential \
cpanminus \
&& rm -rf /var/lib/apt/lists/* /root/.cpan/ /root/.cpanm/
COPY ./docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
EXPOSE 27500/udp
STOPSIGNAL SIGINT
WORKDIR /app
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["perl", "./hlstats.pl"]