Commit Graph

31 Commits

Author SHA1 Message Date
Matt 3a8e601a37 Refactor nginx setup to use host-level configuration
- Remove main nginx ingress container from docker-compose
- Add minimal api-nginx container for FastCGI to HTTP conversion
- Expose services directly on ports 7654 (API) and 7655 (UI)
- Add comprehensive NGINX_SETUP.md documentation
- Include example host nginx configuration
- Update docker setup script for new architecture

This change allows OpnForm to integrate better with existing host nginx
setups by removing the containerized ingress and exposing services
directly to the host for reverse proxy configuration.
2025-06-05 17:42:01 +02:00
Julien Nahum f3a02df80e
Version in self hosted (#770)
* Enhance Application Version Management in Docker and Feature Flags

- Added a new build argument `APP_VERSION` in the Docker configuration files to facilitate version tracking during builds.
- Introduced a private method `getAppVersion` in `FeatureFlagsController` to retrieve the application version from the Docker environment, enhancing the feature flags response with version information.
- Updated the `app.php` configuration file to include a new entry for `docker_version`, allowing for better version management and fallback when the Docker build version is unavailable.

These changes aim to improve the application's versioning capabilities, ensuring that the version is consistently available across different components and environments.

* Refactor OpenFormFooter and Update Feature Flags Handling

- Modified `OpenFormFooter.vue` to include a version display when available, enhancing user awareness of the application version.
- Refactored the script section to use the `<script setup>` syntax, improving readability and reactivity by utilizing `ref` and `computed` for reactive properties.
- Removed the deprecated `feature-flags.js` plugin and updated `featureFlags.js` to ensure proper SSR compatibility and error handling during feature flag fetching.

These changes aim to improve the user interface by providing version information and enhance the overall code structure for better maintainability and performance.
2025-05-27 17:44:42 +02:00
Julien Nahum 014a1f4408 Enhance Application Optimization in Docker Entrypoint
- Added a cache clearing step in the `optimize_application` function of the `php-fpm-entrypoint` script. This new line executes `php ./artisan optimize:clear` before optimizing the application, ensuring that any stale cache is removed, which can lead to improved performance and reliability during application optimization.

This change aims to enhance the application's responsiveness by ensuring that the optimization process starts with a clean state, thereby reducing potential issues related to outdated cached data.
2025-05-23 20:40:56 +02:00
Julien Nahum b34f7b3961 Enhance PHP Configuration Defaults in Docker Entrypoint
- Updated the `php-fpm-entrypoint` script to set default values for PHP configuration settings, including `memory_limit`, `max_execution_time`, `upload_max_filesize`, and `post_max_size`, when not explicitly provided through environment variables. This change ensures that the application has sensible defaults, improving reliability and reducing potential misconfigurations during deployment.

These modifications aim to enhance the Docker setup by providing fallback values for critical PHP settings, thereby streamlining the configuration process and ensuring better performance in various environments.
2025-05-22 19:48:11 +02:00
Julien Nahum 7d7aba10b1 Refactor Docker Entrypoint and Environment Variables
- Removed the `IS_API_WORKER` environment variable from `docker-compose.yml`, simplifying the configuration for API services and aligning with the new role-based command handling.
- Updated the `php-fpm-entrypoint` script to determine the role (API, worker, or scheduler) based on the command being executed, enhancing flexibility and clarity in service initialization.
- Streamlined the setup process for different roles, ensuring that appropriate commands are executed based on the determined role, which improves maintainability and reduces potential errors.

These changes aim to enhance the Docker configuration by adopting a more dynamic approach to service roles, improving the overall deployment process.
2025-05-22 13:21:56 +02:00
Julien Nahum ae21cae8cd
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
JhumanJ 0dfec52cf8 Refactor Docker Configuration and Enhance Build Process
- Removed the build context and Dockerfile specification from the `docker-compose.dev.yml` and `docker-compose.yml` files for the `ui` service, streamlining the configuration.
- Increased Node memory limit in the `Dockerfile.client` to prevent out of memory errors during the build process, ensuring smoother builds and improved performance.

These changes aim to simplify the Docker setup and enhance the reliability of the build process for the client application.
2025-05-15 20:21:36 +02:00
Chirag Chhatrala e7585c32d3
Refactor form property logic rule to load condition mapping from external JSON file (#698)
* Refactor form property logic rule to load condition mapping from external JSON file

* fix CONDITION_MAPPING

* use config file for load mapping

* Simplify condition mapping retrieval in FormPropertyLogicRule

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-02-14 22:32:55 +00:00
Julien Nahum a27eb0acd4 Optimize PHP extension installation in Dockerfile.api
- Separate PHP extension installation into distinct steps
- Add explicit module verification after each extension installation
- Configure optimization flags for more stable builds
- Improve build process with granular extension configuration
2025-02-10 17:33:01 +01:00
Julien Nahum 29640fc70b Enhance Docker API build configuration
- Add system build dependencies for PHP extension compilation
- Update PHP extension installation with explicit configuration
- Configure PostgreSQL extension with explicit path
- Improve build process with parallel extension installation
2025-02-04 20:24:00 +01:00
nielscodes 3acf046975
Update nginx.conf (#687)
Changed undefined variable original_uri to request_uri which should use the original request uri. (nginx container won't start otherwise)

Co-authored-by: Julien Nahum <julien@nahum.net>
2025-02-01 22:48:53 +01:00
Julien Nahum 44a4b983d5 Simplify Docker development setup with minimal configuration
- Remove Redis, queue workers, and scheduler from development environment
- Update docker-compose.dev.yml with simplified service configurations
- Modify Dockerfile.api to support flexible dependency installation
- Update docker-setup.sh script to use single compose file
- Revise Docker development documentation to reflect new lightweight approach
2025-01-29 18:44:42 +01:00
Julien Nahum f7df6bc0d7 Refactor Docker configuration and development setup
- Update .dockerignore with comprehensive ignore patterns for API and client
- Modify docker-compose files to improve service configurations
- Enhance Nginx configuration for development and production environments
- Refactor Dockerfile.api with improved build process
- Add docker-setup.sh script for simplified Docker deployment
- Update update-credentials.vue page with improved UI
- Remove hCaptcha dependency from package-lock.json
- Update PHP configuration and entrypoint scripts
2025-01-29 17:19:36 +01:00
Julien Nahum bf85d8fa76
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
Julien Nahum 1b4e0b2533 Bump node & nuxt depencies 2024-11-20 18:41:56 +01:00
Julien Nahum 7aafc5cab3 GH issue template, docker cache fix, remove docker client entrypoint 2024-09-04 11:19:03 +02:00
Julien Nahum e3eacf1e23 Fix Docker api issues 2024-08-28 17:20:17 +02:00
Julien Nahum 54e24e2e0f Fix the missing directory on docker init 2024-08-28 15:38:55 +02:00
Julien Nahum 2503595786 Reduce docker api image size, fix issues 2024-08-28 15:20:39 +02:00
Julien Nahum 5bd1dda504
Separated laravel app to its own folder (#540) 2024-08-26 18:24:56 +02:00
Julien Nahum fd9067b470
518 setup env command (#519)
* Created command and cleaned

* Simplified docker setup, created script to generate .env

* add git ignore file back
2024-08-08 16:33:01 +02:00
Julien Nahum 3280e38ee1
Docker compose setup (#513)
* fix password reset bug

* self hosted mode middleware changes on  pages

* fix lint

* wip: self hosted changes

* wip: self hosted frontend changes

* wip self hosted mode changes

* typo correction

* remove commented logic

* fix env variable names

* fix lint issues

* fix minor updates

* #445 Switched from single monolithic docker image to a docker-compose
 orchestrated network of services

* Automatically configures shared secret

* Working through some issues

* Use local file storage

* Moved the dockerfiles

* Fixed some issues when building from clean

* Corrected workflow

* Hopefully schedules everything correctly now

* Prep storage for worker process as well

* .env files are required

* Pinned dependency versions

* Disable self hosted in the client as well

* Removed double defaulting logic

* Using regexs is more succinct

* Added FRONT_URL environment variable

* Merge 236e4-self-hosted-mode-changes

* Improve inital user setup

* Finalized the new docker-compose setup

* Fix back-end formatting issues

---------

Co-authored-by: Frank <csskfaves@gmail.com>
Co-authored-by: Don Benjamin <don@webhammer.co.uk>
2024-08-05 12:06:20 +02:00
Don Benjamin 75c2107b6c
#365 Use relative urls in the browser to avoid needing to hardcode the domain name (#375)
* #365 Updated documentation for changing ports.  Updated the nuxt config to use separate internal and external api urls

* #365 Switch to using relative urls

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-04-15 16:02:28 +02:00
Don Benjamin 1dd02cc147
Issue 349/database not created (#372)
* #349 Handle some supervisor warnings and tidy up log output

* Fixed a typo in the README

* #349 --force is necessary when running with APP_ENV=production

* Coderabbit changes for #349
2024-04-12 09:40:14 +02:00
Don Benjamin a854113901
Issue 331 - Fix failing redis persistence (#369)
* #331 Redis was not reading the config file

* #113 Don't create recursive symlink in the storage directory
2024-04-08 14:19:49 +02:00
christianWilling 9883604941
fix local files in docker (#338)
* fix local files in docker

Response::make diesnt exist anymore and the nginx.conf didnt allow the needed paths

* fix import in api.php

---------

Co-authored-by: Christian Willing <cw@c2c-erp.de>
Co-authored-by: Julien Nahum <julien@nahum.net>
2024-03-12 12:29:34 +01:00
Julien Nahum cf32ba22f7
Optimize template images + disable image optim docker (#313)
* Optimize template images + disable image optim docker

* Fix new name default docker env variable name

* Re-establish template page cache
2024-02-06 19:56:14 +01:00
Don Benjamin 129e7feb5f
Reworked docker scripts for new nuxt infrastructure (#285)
* Reworked docker scripts for new nuxt infrastructure

* Switched to log mailer for default docker config

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-01-18 16:35:45 +01:00
Julien Nahum 08db014cde Fix docker 2023-09-14 15:06:45 +02:00
Julien Nahum 6fc1de54dd Update docker image 2023-09-08 18:44:03 +02:00
Don Benjamin 8f84faf3d1
(#146) Re-wrote the docker code to generate a single self-contained d… (#153)
* (#146) Re-wrote the docker code to generate a single self-contained docker
image rather than using a docker-compose network of connected
containers

* (#146) Push version tags to docker hub automatically

* (#146) Switched to using a multistage docker build process to make the Dockerfile more readable and cache friendly without bloating the published image

* #146 More readable names

* #146 Documented the upgrade process and made 'artisan migrate' run on every boot to automate the upgrade process.
2023-07-27 11:34:19 +02:00