All checks were successful
add a health check to the container and option to artisan migrate on boot Co-authored-by: Ruben Momoa <ruben.lobbes@lobbes.nl> Reviewed-on: #25
45 lines
1018 B
Docker
45 lines
1018 B
Docker
ARG BASE_VERSION
|
|
|
|
FROM php:${BASE_VERSION}-fpm-alpine
|
|
|
|
# port to for the webserver
|
|
ENV WEBSERVER_PORT=8080
|
|
|
|
# path without leading / (slash)
|
|
ENV HEALTHCHECK_PATH=""
|
|
|
|
COPY start-container.sh /usr/local/bin/start-container
|
|
|
|
RUN apk add --no-cache \
|
|
curl-dev \
|
|
libxml2-dev \
|
|
oniguruma-dev \
|
|
libpng-dev \
|
|
icu-dev \
|
|
php-ctype \
|
|
php-curl \
|
|
php-dom \
|
|
php-fileinfo \
|
|
php-mbstring \
|
|
php-session \
|
|
php-xml \
|
|
php-intl \
|
|
php-bcmath \
|
|
php-exif \
|
|
php-xmlwriter \
|
|
php-tokenizer \
|
|
php-simplexml \
|
|
php-xmlreader \
|
|
composer \
|
|
npm \
|
|
&& docker-php-ext-install filter pdo_mysql \
|
|
&& chmod +x /usr/local/bin/start-container
|
|
|
|
HEALTHCHECK --interval=5m --timeout=3s --start-period=5m --start-interval=10s \
|
|
CMD curl -f http://localhost:${WEBSERVER_PORT}/${HEALTHCHECK_PATH} || exit 1
|
|
|
|
EXPOSE ${WEBSERVER_PORT}
|
|
|
|
WORKDIR /var/www/html
|
|
|
|
ENTRYPOINT ["start-container"] |