Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
# Build stage - using PHP CLI image with extensions
|
|
|
|
|
FROM php:8.3-cli AS builder
|
2024-08-05 12:06:20 +02:00
|
|
|
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
# Install composer and extensions needed for dependency installation
|
2024-08-28 15:20:39 +02:00
|
|
|
RUN apt-get update && apt-get install -y \
|
2025-01-29 16:00:01 +01:00
|
|
|
libzip-dev \
|
2024-08-28 15:20:39 +02:00
|
|
|
libpng-dev \
|
2025-01-29 16:00:01 +01:00
|
|
|
unzip \
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
git \
|
|
|
|
|
&& docker-php-ext-install -j$(nproc) \
|
|
|
|
|
bcmath \
|
|
|
|
|
gd \
|
|
|
|
|
zip \
|
|
|
|
|
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
2025-01-29 16:00:01 +01:00
|
|
|
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
WORKDIR /app
|
2025-02-10 17:33:01 +01:00
|
|
|
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
# Copy the entire source code for proper installation
|
|
|
|
|
COPY api/ .
|
2025-02-10 17:33:01 +01:00
|
|
|
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
# Install dependencies including dev dependencies
|
|
|
|
|
RUN composer install --optimize-autoloader --no-interaction \
|
|
|
|
|
--ignore-platform-req=php \
|
|
|
|
|
--ignore-platform-req=ext-bcmath \
|
|
|
|
|
--ignore-platform-req=ext-gd
|
2025-02-10 17:33:01 +01:00
|
|
|
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
# Final stage - smaller runtime image
|
|
|
|
|
FROM php:8.3-fpm-alpine
|
2025-02-10 17:33:01 +01:00
|
|
|
|
2025-05-27 17:44:42 +02:00
|
|
|
# Accept version build argument
|
|
|
|
|
ARG APP_VERSION=unknown
|
|
|
|
|
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
# Install runtime dependencies
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
|
libzip \
|
|
|
|
|
libpng \
|
|
|
|
|
postgresql-client \
|
|
|
|
|
libpq \
|
|
|
|
|
procps \
|
|
|
|
|
unzip \
|
|
|
|
|
bash \
|
|
|
|
|
icu-libs \
|
|
|
|
|
&& rm -rf /var/cache/apk/*
|
2025-02-10 17:33:01 +01:00
|
|
|
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
# Install build dependencies and PHP extensions
|
|
|
|
|
RUN apk add --no-cache --virtual .build-deps \
|
|
|
|
|
$PHPIZE_DEPS \
|
|
|
|
|
libzip-dev \
|
|
|
|
|
libpng-dev \
|
|
|
|
|
postgresql-dev \
|
|
|
|
|
oniguruma-dev \
|
|
|
|
|
icu-dev \
|
|
|
|
|
&& docker-php-ext-configure pgsql \
|
|
|
|
|
&& docker-php-ext-configure gd \
|
|
|
|
|
&& docker-php-ext-install -j$(nproc) \
|
|
|
|
|
pdo \
|
|
|
|
|
zip \
|
|
|
|
|
gd \
|
|
|
|
|
pgsql \
|
|
|
|
|
pdo_pgsql \
|
|
|
|
|
bcmath \
|
|
|
|
|
&& pecl install redis \
|
|
|
|
|
&& docker-php-ext-enable redis \
|
|
|
|
|
&& apk del .build-deps
|
2024-08-05 12:06:20 +02:00
|
|
|
|
2025-01-29 16:00:01 +01:00
|
|
|
WORKDIR /usr/share/nginx/html/
|
|
|
|
|
|
|
|
|
|
# Create storage directories
|
|
|
|
|
RUN mkdir -p storage/framework/sessions \
|
|
|
|
|
storage/framework/views \
|
|
|
|
|
storage/framework/cache \
|
|
|
|
|
storage/logs \
|
|
|
|
|
storage/app/public \
|
|
|
|
|
bootstrap/cache \
|
|
|
|
|
&& chown -R www-data:www-data storage bootstrap/cache \
|
|
|
|
|
&& chmod -R 775 storage bootstrap/cache
|
|
|
|
|
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
# Copy the entire application from the builder stage
|
|
|
|
|
COPY --from=builder /app/ ./
|
2024-08-26 18:24:56 +02:00
|
|
|
|
2025-05-27 17:44:42 +02:00
|
|
|
# Set version as environment variable (more reliable than file approach)
|
|
|
|
|
ENV APP_VERSION_DOCKER=$APP_VERSION
|
|
|
|
|
|
2025-01-29 16:00:01 +01:00
|
|
|
# Setup entrypoint
|
2024-08-28 15:20:39 +02:00
|
|
|
COPY docker/php-fpm-entrypoint /usr/local/bin/opnform-entrypoint
|
|
|
|
|
RUN chmod a+x /usr/local/bin/*
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/opnform-entrypoint"]
|
|
|
|
|
CMD ["php-fpm"]
|