-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (39 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
41 lines (39 loc) · 1.04 KB
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
# Build stage
FROM alpine:3.20 AS builds
RUN apk add --no-cache \
autoconf \
automake \
build-base \
clang \
gettext-dev \
libmaxminddb-dev \
openssl-dev \
linux-headers \
ncurses-dev \
pkgconf \
tzdata
# GoAccess
COPY . /goaccess
WORKDIR /goaccess
RUN autoreconf -fiv && rm -rf autom4te.cache
RUN CC="clang" CFLAGS="-O3" LIBS="$(pkg-config --libs openssl)" ./configure --prefix=/usr --enable-utf8 --with-openssl --enable-geoip=mmdb
RUN make -j$(nproc) && make DESTDIR=/dist install
# Check dynamic dependencies
RUN ldd /dist/usr/bin/goaccess && echo "Dependencies checked"
# Runtime stage
FROM alpine:3.20
RUN apk add --no-cache \
gettext-libs \
libmaxminddb \
ncurses-libs \
openssl \
tzdata
# Copy GoAccess binary and assets
COPY --from=builds /dist/usr/bin/goaccess /usr/bin/goaccess
COPY --from=builds /dist/usr/share /usr/share
COPY --from=builds /usr/share/zoneinfo /usr/share/zoneinfo
# Set up volume and port
VOLUME /var/www/goaccess
EXPOSE 7890
ENTRYPOINT ["/usr/bin/goaccess"]
CMD ["--help"]