51 lines
1.2 KiB
Docker
51 lines
1.2 KiB
Docker
# PHP 7.2 == 3.9
|
|
# PHP 7.3 == 3.12
|
|
# PHP 7.4 == 3.15
|
|
ARG OS_VERSION=3.15
|
|
ARG PHP_VERSION=7.4
|
|
|
|
FROM quay.io/sindigilive/php:${PHP_VERSION}-builder-alpine AS builder
|
|
|
|
ARG WITH_APACHE=false
|
|
ARG WITH_DATABASE=false
|
|
|
|
ENV WITH_APACHE=${WITH_APACHE}
|
|
ENV WITH_DATABASE=${WITH_DATABASE}
|
|
|
|
ADD ./scripts/apache-entrypoint.sh /usr/local/bin/entrypoint.sh ;
|
|
|
|
# Create directory, and install required php app
|
|
RUN /bin/sh /tmp/setup.sh; \
|
|
/bin/rm -f /tmp/*.sh; \
|
|
rm -vrf /var/cache/apk/*; \
|
|
chmod +rx /usr/local/bin/entrypoint.sh ;
|
|
|
|
FROM scratch
|
|
|
|
ARG PHP_VERSION=7.4
|
|
ARG PHP_VER_SHORT=7
|
|
|
|
ENV PHP_VERSION=${PHP_VERSION}
|
|
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
|
|
|
|
LABEL maintainer="Muhamad Aditya Prima <map@sindigilive.com>"
|
|
LABEL name="php"
|
|
LABEL version="${PHP_VERSION}"
|
|
LABEL distribution-scope="public"
|
|
|
|
#labels for container catalog
|
|
LABEL summary="PHP ${PHP_VERSION} on alpine based container image"
|
|
LABEL description="Provide php on alpine based container base image"
|
|
LABEL io.k8s.description="Very small alpine linux container image"
|
|
LABEL io.k8s.display-name="PHP ${PHP_VERSION}"
|
|
|
|
COPY --from=builder / /
|
|
|
|
USER apache
|
|
|
|
WORKDIR /app/htdocs
|
|
|
|
STOPSIGNAL SIGQUIT
|
|
|
|
CMD ["/usr/local/bin/entrypoint.sh"]
|