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.
This commit is contained in:
Julien Nahum
2025-05-27 17:44:42 +02:00
committed by GitHub
parent a030a84652
commit f3a02df80e
9 changed files with 68 additions and 38 deletions

View File

@@ -27,6 +27,9 @@ RUN composer install --optimize-autoloader --no-interaction \
# Final stage - smaller runtime image
FROM php:8.3-fpm-alpine
# Accept version build argument
ARG APP_VERSION=unknown
# Install runtime dependencies
RUN apk add --no-cache \
libzip \
@@ -75,6 +78,9 @@ RUN mkdir -p storage/framework/sessions \
# Copy the entire application from the builder stage
COPY --from=builder /app/ ./
# Set version as environment variable (more reliable than file approach)
ENV APP_VERSION_DOCKER=$APP_VERSION
# Setup entrypoint
COPY docker/php-fpm-entrypoint /usr/local/bin/opnform-entrypoint
RUN chmod a+x /usr/local/bin/*