Files
simple-laravel/Dockerfile
vista 1c4212f709
All checks were successful
ci/woodpecker/release/build_release/1 Pipeline was successful
ci/woodpecker/release/build_release/2 Pipeline was successful
ci/woodpecker/release/build_release/3 Pipeline was successful
ci/woodpecker/release/build_release/4 Pipeline was successful
health-check and migrate on boot (#25)
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
2024-08-30 14:29:44 +02:00

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"]