Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add healthcheck to containers #493

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions infra/docker/nginx-client-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ WORKDIR /var/app

ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]

HEALTHCHECK --start-interval=1s --start-period=30s --retries=60 --interval=60s \
CMD wget -O /dev/null http://127.0.0.1/index.html?healthcheck || exit 1
3 changes: 3 additions & 0 deletions infra/docker/nginx-fpm-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ COPY tpl /etc/nginx/tpl
ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]

HEALTHCHECK --start-interval=1s --start-period=20s --retries=20 --interval=60s \
CMD wget -O /dev/null http://127.0.0.1/favicon.ico?healthcheck || exit 1

ENV UPLOAD_MAX_FILE_SIZE=5M

EXPOSE 80
8 changes: 7 additions & 1 deletion infra/docker/php-fpm-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@ RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini \
# Increase process-timeout for "composer test" which downloads phpunit
&& composer config --global process-timeout 2000 \
&& adduser -D -u 1000 app \
&& printf "\nuser = app\ngroup = app\n" >> /usr/local/etc/php-fpm.d/zz-docker.conf
&& printf "\nuser = app\ngroup = app\n" >> /usr/local/etc/php-fpm.d/zz-docker.conf \
&& wget -O /usr/local/bin/php-fpm-healthcheck https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/v0.5.0/php-fpm-healthcheck \
&& chmod +x /usr/local/bin/php-fpm-healthcheck \
&& printf "pm.status_path = /status\n" >> /usr/local/etc/php-fpm.d/zz-docker.conf

WORKDIR /srv/app

RUN chown -R app:app .

CMD ["true"]

HEALTHCHECK --start-interval=2s --start-period=30s --retries=50 --interval=60s --timeout=3s \
CMD php-fpm-healthcheck || exit 1
Loading