opnform-host-nginx/docker-compose.yml

157 lines
4.2 KiB
YAML
Raw Normal View History

services:
api:
image: jhumanj/opnform-api:latest
container_name: opnform-api
volumes:
- opnform_storage:/usr/share/nginx/html/storage:rw
environment:
APP_ENV: production
# Database settings
DB_HOST: db
REDIS_HOST: redis
DB_DATABASE: ${DB_DATABASE:-forge}
DB_USERNAME: ${DB_USERNAME:-forge}
DB_PASSWORD: ${DB_PASSWORD:-forge}
DB_CONNECTION: ${DB_CONNECTION:-pgsql}
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
# PHP Configuration
PHP_MEMORY_LIMIT: "1G"
PHP_MAX_EXECUTION_TIME: "600"
PHP_UPLOAD_MAX_FILESIZE: "64M"
PHP_POST_MAX_SIZE: "64M"
env_file:
- ./api/.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
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
healthcheck:
test: ["CMD-SHELL", "pgrep php-fpm > /dev/null || exit 1"]
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
interval: 30s
timeout: 15s
retries: 3
start_period: 90s
restart: unless-stopped
api-nginx:
image: nginx:alpine
container_name: opnform-api-nginx
volumes:
- ./docker/api-nginx.conf:/etc/nginx/nginx.conf:ro
- opnform_storage:/usr/share/nginx/html/storage:ro
ports:
- "0.0.0.0:7654:80" # API on port 7654 - accessible from any IP
depends_on:
api:
condition: service_started
restart: unless-stopped
api-worker:
image: jhumanj/opnform-api:latest
container_name: opnform-api-worker
command: ["php", "artisan", "queue:work"]
volumes:
- opnform_storage:/usr/share/nginx/html/storage:rw
2024-08-28 17:20:17 +02:00
environment:
APP_ENV: production
# Database settings
DB_HOST: db
REDIS_HOST: redis
DB_DATABASE: ${DB_DATABASE:-forge}
DB_USERNAME: ${DB_USERNAME:-forge}
DB_PASSWORD: ${DB_PASSWORD:-forge}
DB_CONNECTION: ${DB_CONNECTION:-pgsql}
# PHP Configuration
PHP_MEMORY_LIMIT: "1G"
PHP_MAX_EXECUTION_TIME: "600"
PHP_UPLOAD_MAX_FILESIZE: "64M"
PHP_POST_MAX_SIZE: "64M"
env_file:
- ./api/.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
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
healthcheck:
test: ["CMD-SHELL", "pgrep -f 'php artisan queue:work' > /dev/null || exit 1"]
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
api-scheduler:
image: jhumanj/opnform-api:latest
container_name: opnform-api-scheduler
command: ["php", "artisan", "schedule:work"]
volumes:
- opnform_storage:/usr/share/nginx/html/storage:rw
environment:
APP_ENV: production
# Database settings
DB_HOST: db
REDIS_HOST: redis
DB_DATABASE: ${DB_DATABASE:-forge}
DB_USERNAME: ${DB_USERNAME:-forge}
DB_PASSWORD: ${DB_PASSWORD:-forge}
DB_CONNECTION: ${DB_CONNECTION:-pgsql}
# PHP Configuration
PHP_MEMORY_LIMIT: "1G"
PHP_MAX_EXECUTION_TIME: "600"
PHP_UPLOAD_MAX_FILESIZE: "64M"
PHP_POST_MAX_SIZE: "64M"
env_file:
- ./api/.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
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
healthcheck:
test: ["CMD-SHELL", "php /usr/share/nginx/html/artisan app:scheduler-status --mode=check --max-minutes=3 || exit 1"]
interval: 60s
timeout: 30s
retries: 3
start_period: 70s
ui:
image: jhumanj/opnform-client:latest
container_name: opnform-client
ports:
- "0.0.0.0:7655:3000" # UI on port 7655 - accessible from any IP
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
env_file:
- ./client/.env
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
healthcheck:
test: ["CMD-SHELL", "wget --spider -q http://localhost:3000/login || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 45s
restart: unless-stopped
redis:
image: redis:7
container_name: opnform-redis
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
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 30s
timeout: 5s
db:
image: postgres:16
container_name: opnform-db
environment:
POSTGRES_DB: ${DB_DATABASE:-forge}
POSTGRES_USER: ${DB_USERNAME:-forge}
POSTGRES_PASSWORD: ${DB_PASSWORD:-forge}
Developer docker setup (#683) * Add build context to compose Signed-off-by: Daniel Ekman <knegge@gmail.com> * Update Docker documentation with build instructions Enhance Docker deployment documentation by: - Adding detailed instructions for building Docker images - Providing two methods for image building (Docker Compose and manual) - Clarifying how to use local images with docker-compose.override.yml * Add development Docker configuration Introduce development-specific Docker configuration: - Create docker-compose.dev.yml for local development setup - Add nginx.dev.conf with development CORS settings - Update Dockerfile.api to support environment-specific dependency installation - Configure development services with appropriate volumes and environment variables * Improve Docker and Development Documentation - Remove platform-specific ARM64 constraints in docker-compose.dev.yml - Enhance Nginx configuration with improved proxy and HMR settings - Update documentation for development setup and Docker deployment - Add new Docker development documentation page - Refactor getting started guide with clearer development instructions * Enhance Docker configuration and CI/CD pipeline - Update Docker Compose files with improved service configurations - Add database healthcheck in docker-compose.yml - Refactor GitHub Actions workflow for Docker image publishing - Optimize Dockerfile.api with multi-stage build and environment-specific configurations - Update Nginx configuration for development and production environments * Add GitHub Actions permissions for Docker image publishing Configure GitHub Actions workflow with explicit read and write permissions for content and packages to improve security and clarity of Docker image deployment process --------- Signed-off-by: Daniel Ekman <knegge@gmail.com> Co-authored-by: Daniel Ekman <knegge@gmail.com>
2025-01-28 17:52:48 +01:00
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-forge}"]
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
interval: 30s
Developer docker setup (#683) * Add build context to compose Signed-off-by: Daniel Ekman <knegge@gmail.com> * Update Docker documentation with build instructions Enhance Docker deployment documentation by: - Adding detailed instructions for building Docker images - Providing two methods for image building (Docker Compose and manual) - Clarifying how to use local images with docker-compose.override.yml * Add development Docker configuration Introduce development-specific Docker configuration: - Create docker-compose.dev.yml for local development setup - Add nginx.dev.conf with development CORS settings - Update Dockerfile.api to support environment-specific dependency installation - Configure development services with appropriate volumes and environment variables * Improve Docker and Development Documentation - Remove platform-specific ARM64 constraints in docker-compose.dev.yml - Enhance Nginx configuration with improved proxy and HMR settings - Update documentation for development setup and Docker deployment - Add new Docker development documentation page - Refactor getting started guide with clearer development instructions * Enhance Docker configuration and CI/CD pipeline - Update Docker Compose files with improved service configurations - Add database healthcheck in docker-compose.yml - Refactor GitHub Actions workflow for Docker image publishing - Optimize Dockerfile.api with multi-stage build and environment-specific configurations - Update Nginx configuration for development and production environments * Add GitHub Actions permissions for Docker image publishing Configure GitHub Actions workflow with explicit read and write permissions for content and packages to improve security and clarity of Docker image deployment process --------- Signed-off-by: Daniel Ekman <knegge@gmail.com> Co-authored-by: Daniel Ekman <knegge@gmail.com>
2025-01-28 17:52:48 +01:00
timeout: 5s
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
2024-08-28 17:20:17 +02:00
postgres-data:
opnform_storage: