2022-10-10 02:05:02 -04:00
|
|
|
FROM casjaysdevdocker/python2:latest AS build
|
2022-02-14 16:44:08 -05:00
|
|
|
|
2022-10-11 16:50:15 -04:00
|
|
|
ARG PORTS="80 443 9090"
|
|
|
|
|
|
|
|
ENV CFLAGS="-static"
|
2022-10-10 22:32:35 -04:00
|
|
|
|
2022-02-14 16:44:08 -05:00
|
|
|
WORKDIR /tmp/build
|
|
|
|
|
|
|
|
RUN apk -U upgrade && \
|
|
|
|
apk add --no-cache \
|
|
|
|
alpine-sdk \
|
|
|
|
autoconf \
|
2022-10-11 13:38:12 -04:00
|
|
|
musl-dev \
|
2022-02-14 16:44:08 -05:00
|
|
|
automake \
|
|
|
|
gettext \
|
|
|
|
git \
|
|
|
|
libtool \
|
2022-10-11 19:01:22 -04:00
|
|
|
openssl \
|
|
|
|
openssl-dev \
|
2022-02-14 16:44:08 -05:00
|
|
|
linux-headers \
|
2022-09-07 09:58:10 -04:00
|
|
|
rrdtool \
|
2022-10-11 09:57:13 -04:00
|
|
|
ffmpeg-dev \
|
|
|
|
geoip-dev \
|
2022-09-07 09:58:10 -04:00
|
|
|
php8-cgi
|
2022-02-14 16:44:08 -05:00
|
|
|
|
2022-10-11 18:57:47 -04:00
|
|
|
RUN mkdir -p "/usr/local/share/template-files/config/defaults/cherokee" "/buildroot" && \
|
2022-10-11 17:47:56 -04:00
|
|
|
cd /tmp/build && \
|
2022-10-11 16:22:27 -04:00
|
|
|
git clone https://github.com/cherokee/webserver.git . && \
|
2022-10-11 16:50:15 -04:00
|
|
|
/usr/bin/libtoolize && \
|
|
|
|
aclocal && autoheader && touch ./ChangeLog ./README && autoconf && \
|
2022-10-11 18:57:47 -04:00
|
|
|
./autogen.sh --prefix=/usr/local/share/cherokee --sysconfdir=/etc/cherokee --localstatedir=/tmp/cherokee --enable-static-module=all --enable-static --enable-shared=no && \
|
2022-10-11 16:50:15 -04:00
|
|
|
autoreconf -iv && \
|
2022-10-11 16:22:27 -04:00
|
|
|
make && make install && \
|
2022-10-11 13:09:14 -04:00
|
|
|
echo "<p style='text-align:center'>Built from $(git rev-parse --short HEAD) on $(date)</p>" > ./version.txt && \
|
2022-10-10 10:50:46 -04:00
|
|
|
apk del --no-cache \
|
2022-02-14 16:44:08 -05:00
|
|
|
alpine-sdk \
|
|
|
|
autoconf \
|
|
|
|
automake \
|
|
|
|
gettext \
|
2022-10-11 09:57:13 -04:00
|
|
|
openssl-dev \
|
|
|
|
linux-headers \
|
|
|
|
ffmpeg-dev \
|
|
|
|
geoip-dev \
|
2022-10-10 10:50:46 -04:00
|
|
|
libtool && \
|
2022-10-11 16:50:15 -04:00
|
|
|
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=CA/L=CA/O=Cherokee/OU=Cherokee/CN=localhost" -keyout /etc/ssl/key.pem -out /etc/ssl/crt.pem && \
|
2022-10-11 16:22:27 -04:00
|
|
|
ln -sf /usr/local/share/cherokee/bin/* /usr/local/bin/ && \
|
2022-10-11 17:05:07 -04:00
|
|
|
ln -sf /usr/local/share/cherokee/sbin/* /usr/local/bin/ && \
|
2022-10-11 18:57:47 -04:00
|
|
|
cp -Rf "/etc/cherokee/." "/usr/local/share/template-files/config/defaults/cherokee/" && \
|
2022-10-11 12:39:39 -04:00
|
|
|
cp -Rf "/usr/local/." "/buildroot/" && \
|
2022-10-11 16:22:27 -04:00
|
|
|
rm -Rf /var/cache/apk/* /tmp/* /var/tmp/* /tmp/build /usr/src/*
|
2022-02-14 16:44:08 -05:00
|
|
|
|
2022-10-11 11:25:06 -04:00
|
|
|
FROM casjaysdevdocker/php:latest AS source
|
2022-10-11 12:26:36 -04:00
|
|
|
|
2022-10-11 19:01:22 -04:00
|
|
|
RUN apk add --no-cache geoip rrdtool openssl && \
|
2022-10-11 17:47:56 -04:00
|
|
|
rm -Rf /var/cache/apk/* /tmp/* /var/tmp/*
|
|
|
|
|
2022-10-11 12:26:36 -04:00
|
|
|
COPY --from=build /buildroot/. /usr/local/
|
2022-10-11 11:25:06 -04:00
|
|
|
COPY ./bin/. /usr/local/bin/
|
|
|
|
COPY ./data/. /usr/local/share/template-files/data/
|
|
|
|
COPY ./config/. /usr/local/share/template-files/config/
|
|
|
|
|
|
|
|
FROM scratch
|
2022-07-06 23:15:47 -04:00
|
|
|
ARG BUILD_DATE="$(date +'%Y-%m-%d %H:%M')"
|
2022-02-14 16:44:08 -05:00
|
|
|
|
|
|
|
LABEL \
|
|
|
|
org.label-schema.name="cherokee" \
|
|
|
|
description="Alpine based image with cherokee and php8." \
|
2022-07-09 13:21:25 -04:00
|
|
|
org.label-schema.url="https://hub.docker.com/r/casjaysdevdocker/cherokee" \
|
|
|
|
org.label-schema.vcs-url="https://github.com/casjaysdevdocker/cherokee" \
|
2022-02-14 16:44:08 -05:00
|
|
|
org.label-schema.build-date=$BUILD_DATE \
|
|
|
|
org.label-schema.version=$BUILD_DATE \
|
|
|
|
org.label-schema.vcs-ref=$BUILD_DATE \
|
2022-07-09 13:21:25 -04:00
|
|
|
org.label-schema.license="WTFPL" \
|
2022-02-14 16:44:08 -05:00
|
|
|
org.label-schema.vcs-type="Git" \
|
|
|
|
org.label-schema.schema-version="1.0" \
|
|
|
|
org.label-schema.vendor="CasjaysDev" \
|
2022-07-06 23:15:47 -04:00
|
|
|
maintainer="CasjaysDev <docker-admin@casjaysdev.com>"
|
2022-02-14 16:44:08 -05:00
|
|
|
|
2022-10-11 11:25:06 -04:00
|
|
|
COPY --from=source /. /
|
2022-02-14 16:44:08 -05:00
|
|
|
|
|
|
|
ENV PHP_SERVER=cherokee
|
|
|
|
|
2022-10-10 22:32:35 -04:00
|
|
|
WORKDIR /data/htdocs/www
|
2022-02-14 16:44:08 -05:00
|
|
|
|
2022-10-10 22:32:35 -04:00
|
|
|
EXPOSE $PORTS
|
2022-02-14 16:44:08 -05:00
|
|
|
|
2022-10-10 02:05:02 -04:00
|
|
|
VOLUME [ "/data", "/config" ]
|
2022-02-14 16:44:08 -05:00
|
|
|
|
2022-09-07 09:58:10 -04:00
|
|
|
ENTRYPOINT [ "tini", "--" ]
|
2022-10-07 18:47:10 -04:00
|
|
|
HEALTHCHECK --interval=15s --timeout=3s CMD [ "/usr/local/bin/entrypoint-cherokee.sh" "healthcheck" ]
|
2022-02-14 16:44:08 -05:00
|
|
|
CMD ["/usr/local/bin/entrypoint-cherokee.sh"]
|
2022-09-07 09:58:10 -04:00
|
|
|
|