From 07cdb4ddcc523b91b3997a6c7ebb03094ca0743e Mon Sep 17 00:00:00 2001 From: alexbaron-dev Date: Thu, 22 May 2025 18:03:39 +0200 Subject: [PATCH 01/13] Create opnform.yaml Add opnform.yaml as template to deploy OpnForm app --- templates/compose/opnform.yaml | 232 +++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 templates/compose/opnform.yaml diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml new file mode 100644 index 000000000..1fe9644b6 --- /dev/null +++ b/templates/compose/opnform.yaml @@ -0,0 +1,232 @@ +# documentation: https://docs.opnform.com/introduction +# slogan: OpnForm is an open-source form builder that lets you create beautiful forms and share them anywhere. It's super fast, you don't need to know how to code +# tags: opnform, form, survey, cloud, open-source, self-hosted, docker, no-code, embeddable +# logo: svg/opnform.svg +# port: 80 + +x-shared-env: &shared-api-env + APP_NAME: "OpnForm" + APP_ENV: production + APP_KEY: ${SERVICE_BASE64_APIKEY} + APP_DEBUG: ${APP_DEBUG:-false} + APP_URL: ${SERVICE_FQDN_NGINX} + SELF_HOSTED: ${SELF_HOSTED:-true} + LOG_CHANNEL: errorlog + LOG_LEVEL: ${LOG_LEVEL:-debug} + FILESYSTEM_DRIVER: ${FILESYSTEM_DRIVER:-local} + LOCAL_FILESYSTEM_VISIBILITY: public + CACHE_DRIVER: redis + QUEUE_CONNECTION: redis + SESSION_DRIVER: redis + SESSION_LIFETIME: 120 + MAIL_MAILER: ${MAIL_MAILER:-log} + MAIL_HOST: ${MAIL_HOST} + MAIL_PORT: ${MAIL_PORT} + MAIL_USERNAME: ${MAIL_USERNAME:-your@email.com} + MAIL_PASSWORD: ${MAIL_PASSWORD} + MAIL_ENCRYPTION: ${MAIL_ENCRYPTION} + MAIL_FROM_ADDRESS: ${MAIL_FROM_ADDRESS:-your@email.com} + MAIL_FROM_NAME: ${MAIL_FROM_NAME:-OpnForm} + AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} + AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} + AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION:-us-east-1} + AWS_BUCKET: ${AWS_BUCKET} + JWT_TTL: ${JWT_TTL:-1440} + JWT_SECRET: ${SERVICE_PASSWORD_JWTSECRET} + JWT_SKIP_IP_UA_VALIDATION: ${JWT_SKIP_IP_UA_VALIDATION:-true} + OPEN_AI_API_KEY: ${OPEN_AI_API_KEY} + H_CAPTCHA_SITE_KEY: ${H_CAPTCHA_SITE_KEY} + H_CAPTCHA_SECRET_KEY: ${H_CAPTCHA_SECRET_KEY} + RE_CAPTCHA_SITE_KEY: ${RE_CAPTCHA_SITE_KEY} + RE_CAPTCHA_SECRET_KEY: ${RE_CAPTCHA_SECRET_KEY} + TELEGRAM_BOT_ID: ${TELEGRAM_BOT_ID} + TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN} + SHOW_OFFICIAL_TEMPLATES: ${SHOW_OFFICIAL_TEMPLATES:-true} + REDIS_HOST: redis + REDIS_PASSWORD: ${SERVICE_PASSWORD_64_REDIS} + # Database settings + DB_HOST: postgresql + DB_DATABASE: ${POSTGRESQL_DATABASE:-opnform} + DB_USERNAME: ${SERVICE_USER_POSTGRESQL} + DB_PASSWORD: ${SERVICE_PASSWORD_POSTGRESQL} + DB_CONNECTION: pgsql + # PHP Configuration + PHP_MEMORY_LIMIT: "1G" + PHP_MAX_EXECUTION_TIME: "600" + PHP_UPLOAD_MAX_FILESIZE: "64M" + PHP_POST_MAX_SIZE: "64M" + +services: + opnform-api: + image: jhumanj/opnform-api:latest + volumes: &api-environment-volumes + - api-storage:/usr/share/nginx/html/storage:rw + environment: + # Use the shared environment variables. + <<: *shared-api-env + depends_on: + postgresql: + condition: service_healthy + redis: + condition: service_healthy + healthcheck: + test: ["CMD-SHELL", "php /usr/share/nginx/html/artisan about || exit 1"] + interval: 30s + timeout: 15s + retries: 3 + start_period: 60s + + api-worker: + image: jhumanj/opnform-api:latest + volumes: *api-environment-volumes + environment: + # Use the shared environment variables. + <<: *shared-api-env + command: ["php", "artisan", "queue:work"] + depends_on: + postgresql: + condition: service_healthy + redis: + condition: service_healthy + 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 + volumes: *api-environment-volumes + environment: + # Use the shared environment variables. + <<: *shared-api-env + command: ["php", "artisan", "schedule:work"] + depends_on: + postgresql: + condition: service_healthy + redis: + condition: service_healthy + 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 # Allow time for first scheduled run and cache write + + opnform-ui: + image: jhumanj/opnform-client:latest + environment: + - NUXT_PUBLIC_APP_URL=/ + - NUXT_PUBLIC_API_BASE=/api + - NUXT_PRIVATE_API_BASE=http://nginx/api + - NUXT_PUBLIC_ENV=${NUXT_PUBLIC_ENV:-production} + - NUXT_PUBLIC_H_CAPTCHA_SITE_KEY=${H_CAPTCHA_SITE_KEY} + - NUXT_PUBLIC_RE_CAPTCHA_SITE_KEY=${RE_CAPTCHA_SITE_KEY} + - NUXT_PUBLIC_ROOT_REDIRECT_URL=${NUXT_PUBLIC_ROOT_REDIRECT_URL} + healthcheck: + test: ["CMD-SHELL", "wget --spider -q http://opnform-ui:3000/login || exit 1"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 45s + + postgresql: + image: postgres:16 + volumes: + - opnform-postgresql-data:/var/lib/postgresql/data + environment: + POSTGRES_USER: ${SERVICE_USER_POSTGRESQL} + POSTGRES_PASSWORD: ${SERVICE_PASSWORD_POSTGRESQL} + POSTGRES_DB: ${POSTGRESQL_DATABASE:-opnform} + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 20s + retries: 10 + + redis: + image: redis:7 + environment: + REDIS_PASSWORD: ${SERVICE_PASSWORD_64_REDIS} + volumes: + - redis-data:/data + command: ["redis-server", "--requirepass", "${SERVICE_PASSWORD_64_REDIS}"] + healthcheck: + test: ["CMD", "redis-cli", "-a", "${SERVICE_PASSWORD_64_REDIS}", "PING"] + interval: 10s + timeout: 30s + retries: 3 + + # The nginx reverse proxy. + # used for reverse proxying the API service and Web service. + nginx: + image: nginx:latest + volumes: + - type: bind + source: ./nginx/nginx.conf.template + target: /etc/nginx/conf.d/opnform.conf + read_only: true + content: | + map $request_uri $api_uri { + ~^/api(/.*$) $1; + default $request_uri; + } + + server { + listen 80 default_server; + root /usr/share/nginx/html/public; + + access_log /dev/stdout; + error_log /dev/stderr error; + + index index.html index.htm index.php; + + location / { + proxy_http_version 1.1; + proxy_pass http://opnform-ui:3000; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location ~/(api|open|local\/temp|forms\/assets)/ { + set $original_uri $uri; + try_files $uri $uri/ /index.php$is_args$args; + } + + location ~ \.php$ { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass opnform-api:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root/index.php; + fastcgi_param REQUEST_URI $api_uri; + } + + # Deny access to . files + location ~ /\. { + deny all; + } + } + environment: + - SERVICE_FQDN_NGINX + depends_on: + - opnform-api + - opnform-ui + healthcheck: + test: ["CMD", "nginx", "-t"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + +volumes: + api-storage: + driver: local + opnform-postgresql-data: + driver: local + redis-data: + driver: local From c4cb0f70367e168d228ca55858bb4f2366ab9419 Mon Sep 17 00:00:00 2001 From: alexbaron-dev Date: Thu, 22 May 2025 18:08:24 +0200 Subject: [PATCH 02/13] Add opnform logo into svgs directory --- public/svgs/opnform.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 public/svgs/opnform.svg diff --git a/public/svgs/opnform.svg b/public/svgs/opnform.svg new file mode 100644 index 000000000..70562a4bf --- /dev/null +++ b/public/svgs/opnform.svg @@ -0,0 +1 @@ + \ No newline at end of file From 934126778370673472a1907747108d32af1b4cbb Mon Sep 17 00:00:00 2001 From: alexbaron-dev Date: Fri, 23 May 2025 18:32:26 +0200 Subject: [PATCH 03/13] Update opnform.yaml - split environment variables per usage (api, worker and scheduler) - remove volume anchor - remove volumes definition --- templates/compose/opnform.yaml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 1fe9644b6..1b658bca9 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -31,17 +31,9 @@ x-shared-env: &shared-api-env AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION:-us-east-1} AWS_BUCKET: ${AWS_BUCKET} - JWT_TTL: ${JWT_TTL:-1440} - JWT_SECRET: ${SERVICE_PASSWORD_JWTSECRET} - JWT_SKIP_IP_UA_VALIDATION: ${JWT_SKIP_IP_UA_VALIDATION:-true} OPEN_AI_API_KEY: ${OPEN_AI_API_KEY} - H_CAPTCHA_SITE_KEY: ${H_CAPTCHA_SITE_KEY} - H_CAPTCHA_SECRET_KEY: ${H_CAPTCHA_SECRET_KEY} - RE_CAPTCHA_SITE_KEY: ${RE_CAPTCHA_SITE_KEY} - RE_CAPTCHA_SECRET_KEY: ${RE_CAPTCHA_SECRET_KEY} TELEGRAM_BOT_ID: ${TELEGRAM_BOT_ID} TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN} - SHOW_OFFICIAL_TEMPLATES: ${SHOW_OFFICIAL_TEMPLATES:-true} REDIS_HOST: redis REDIS_PASSWORD: ${SERVICE_PASSWORD_64_REDIS} # Database settings @@ -59,11 +51,19 @@ x-shared-env: &shared-api-env services: opnform-api: image: jhumanj/opnform-api:latest - volumes: &api-environment-volumes - - api-storage:/usr/share/nginx/html/storage:rw + volumes: + - api-storage:/usr/share/nginx/html/storage environment: # Use the shared environment variables. <<: *shared-api-env + JWT_TTL: ${JWT_TTL:-1440} + JWT_SECRET: ${SERVICE_PASSWORD_JWTSECRET} + JWT_SKIP_IP_UA_VALIDATION: ${JWT_SKIP_IP_UA_VALIDATION:-true} + H_CAPTCHA_SITE_KEY: ${H_CAPTCHA_SITE_KEY} + H_CAPTCHA_SECRET_KEY: ${H_CAPTCHA_SECRET_KEY} + RE_CAPTCHA_SITE_KEY: ${RE_CAPTCHA_SITE_KEY} + RE_CAPTCHA_SECRET_KEY: ${RE_CAPTCHA_SECRET_KEY} + SHOW_OFFICIAL_TEMPLATES: ${SHOW_OFFICIAL_TEMPLATES:-true} depends_on: postgresql: condition: service_healthy @@ -78,7 +78,8 @@ services: api-worker: image: jhumanj/opnform-api:latest - volumes: *api-environment-volumes + volumes: + - api-storage:/usr/share/nginx/html/storage environment: # Use the shared environment variables. <<: *shared-api-env @@ -97,7 +98,8 @@ services: api-scheduler: image: jhumanj/opnform-api:latest - volumes: *api-environment-volumes + volumes: + - api-storage:/usr/share/nginx/html/storage environment: # Use the shared environment variables. <<: *shared-api-env @@ -222,11 +224,3 @@ services: timeout: 10s retries: 3 start_period: 40s - -volumes: - api-storage: - driver: local - opnform-postgresql-data: - driver: local - redis-data: - driver: local From 4363fbd60ccee380626b8a5c9b91c8f951e9d94f Mon Sep 17 00:00:00 2001 From: alexbaron-dev Date: Fri, 17 Oct 2025 20:16:48 +0200 Subject: [PATCH 04/13] Update Docker images to specific versions --- templates/compose/opnform.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 1b658bca9..c5218f2c4 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -50,7 +50,7 @@ x-shared-env: &shared-api-env services: opnform-api: - image: jhumanj/opnform-api:latest + image: jhumanj/opnform-api:1.9.7 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -77,7 +77,7 @@ services: start_period: 60s api-worker: - image: jhumanj/opnform-api:latest + image: jhumanj/opnform-api:1.9.7 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -97,7 +97,7 @@ services: start_period: 30s api-scheduler: - image: jhumanj/opnform-api:latest + image: jhumanj/opnform-api:1.9.7 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -117,7 +117,7 @@ services: start_period: 70s # Allow time for first scheduled run and cache write opnform-ui: - image: jhumanj/opnform-client:latest + image: jhumanj/opnform-client:1.9.6 environment: - NUXT_PUBLIC_APP_URL=/ - NUXT_PUBLIC_API_BASE=/api @@ -163,7 +163,7 @@ services: # The nginx reverse proxy. # used for reverse proxying the API service and Web service. nginx: - image: nginx:latest + image: nginx:1.29.2 volumes: - type: bind source: ./nginx/nginx.conf.template From c5fad13ab2d9e9acdadf3070ca521ff063bac234 Mon Sep 17 00:00:00 2001 From: alexbaron-dev Date: Sun, 19 Oct 2025 15:28:08 +0200 Subject: [PATCH 05/13] Upgrade opnform API and UI images to version 1.10.0 --- templates/compose/opnform.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index c5218f2c4..7cf7b4cbb 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -50,7 +50,7 @@ x-shared-env: &shared-api-env services: opnform-api: - image: jhumanj/opnform-api:1.9.7 + image: jhumanj/opnform-api:1.10.0 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -77,7 +77,7 @@ services: start_period: 60s api-worker: - image: jhumanj/opnform-api:1.9.7 + image: jhumanj/opnform-api:1.10.0 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -97,7 +97,7 @@ services: start_period: 30s api-scheduler: - image: jhumanj/opnform-api:1.9.7 + image: jhumanj/opnform-api:1.10.0 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -117,7 +117,7 @@ services: start_period: 70s # Allow time for first scheduled run and cache write opnform-ui: - image: jhumanj/opnform-client:1.9.6 + image: jhumanj/opnform-client:1.10.0 environment: - NUXT_PUBLIC_APP_URL=/ - NUXT_PUBLIC_API_BASE=/api From 9c99937dd0e34011f14b28461c34c0ad9281db1e Mon Sep 17 00:00:00 2001 From: alexbaron-dev Date: Sun, 19 Oct 2025 17:52:12 +0200 Subject: [PATCH 06/13] Update environment variable syntax in opnform.yaml for consistency --- templates/compose/opnform.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 7cf7b4cbb..860b72eca 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -119,13 +119,13 @@ services: opnform-ui: image: jhumanj/opnform-client:1.10.0 environment: - - NUXT_PUBLIC_APP_URL=/ - - NUXT_PUBLIC_API_BASE=/api - - NUXT_PRIVATE_API_BASE=http://nginx/api - - NUXT_PUBLIC_ENV=${NUXT_PUBLIC_ENV:-production} - - NUXT_PUBLIC_H_CAPTCHA_SITE_KEY=${H_CAPTCHA_SITE_KEY} - - NUXT_PUBLIC_RE_CAPTCHA_SITE_KEY=${RE_CAPTCHA_SITE_KEY} - - NUXT_PUBLIC_ROOT_REDIRECT_URL=${NUXT_PUBLIC_ROOT_REDIRECT_URL} + NUXT_PUBLIC_APP_URL: ${NUXT_PUBLIC_APP_URL:-/} + NUXT_PUBLIC_API_BASE: ${NUXT_PUBLIC_API_BASE:-/api} + NUXT_PRIVATE_API_BASE: ${NUXT_PRIVATE_API_BASE:-http://nginx/api} + NUXT_PUBLIC_ENV: ${NUXT_PUBLIC_ENV:-production} + NUXT_PUBLIC_H_CAPTCHA_SITE_KEY: ${H_CAPTCHA_SITE_KEY} + NUXT_PUBLIC_RE_CAPTCHA_SITE_KEY: ${RE_CAPTCHA_SITE_KEY} + NUXT_PUBLIC_ROOT_REDIRECT_URL: ${NUXT_PUBLIC_ROOT_REDIRECT_URL} healthcheck: test: ["CMD-SHELL", "wget --spider -q http://opnform-ui:3000/login || exit 1"] interval: 30s From dd0575a1ac895545dbba3d2dc24f34c6aa9462eb Mon Sep 17 00:00:00 2001 From: JhumanJ Date: Fri, 31 Oct 2025 17:40:04 +0100 Subject: [PATCH 07/13] Update opnform.yaml to use version 1.10.1 for API and UI images, and correct APP_URL environment variable reference --- templates/compose/opnform.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 860b72eca..7e311e5a6 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -9,7 +9,7 @@ x-shared-env: &shared-api-env APP_ENV: production APP_KEY: ${SERVICE_BASE64_APIKEY} APP_DEBUG: ${APP_DEBUG:-false} - APP_URL: ${SERVICE_FQDN_NGINX} + APP_URL: ${SERVICE_FQDN_OPNFORM} SELF_HOSTED: ${SELF_HOSTED:-true} LOG_CHANNEL: errorlog LOG_LEVEL: ${LOG_LEVEL:-debug} @@ -50,7 +50,7 @@ x-shared-env: &shared-api-env services: opnform-api: - image: jhumanj/opnform-api:1.10.0 + image: jhumanj/opnform-api:1.10.1 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -77,7 +77,7 @@ services: start_period: 60s api-worker: - image: jhumanj/opnform-api:1.10.0 + image: jhumanj/opnform-api:1.10.1 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -90,14 +90,15 @@ services: redis: condition: service_healthy healthcheck: - test: ["CMD-SHELL", "pgrep -f 'php artisan queue:work' > /dev/null || exit 1"] + 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:1.10.0 + image: jhumanj/opnform-api:1.10.1 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -110,14 +111,18 @@ services: redis: condition: service_healthy healthcheck: - test: ["CMD-SHELL", "php /usr/share/nginx/html/artisan app:scheduler-status --mode=check --max-minutes=3 || exit 1"] + 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 # Allow time for first scheduled run and cache write opnform-ui: - image: jhumanj/opnform-client:1.10.0 + image: jhumanj/opnform-client:1.10.1 environment: NUXT_PUBLIC_APP_URL: ${NUXT_PUBLIC_APP_URL:-/} NUXT_PUBLIC_API_BASE: ${NUXT_PUBLIC_API_BASE:-/api} @@ -127,7 +132,8 @@ services: NUXT_PUBLIC_RE_CAPTCHA_SITE_KEY: ${RE_CAPTCHA_SITE_KEY} NUXT_PUBLIC_ROOT_REDIRECT_URL: ${NUXT_PUBLIC_ROOT_REDIRECT_URL} healthcheck: - test: ["CMD-SHELL", "wget --spider -q http://opnform-ui:3000/login || exit 1"] + test: + ["CMD-SHELL", "wget --spider -q http://opnform-ui:3000/login || exit 1"] interval: 30s timeout: 10s retries: 3 @@ -214,7 +220,7 @@ services: } } environment: - - SERVICE_FQDN_NGINX + - SERVICE_FQDN_OPNFORM depends_on: - opnform-api - opnform-ui From c960b7107639f90f8f355f0b815d4c3c0eb5f30d Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Sun, 9 Nov 2025 16:05:04 +0100 Subject: [PATCH 08/13] Update opnform.yaml to use version 1.10.2 for API and UI images, remove SELF_HOSTED environment variable, and adjust environment variable syntax for consistency --- templates/compose/opnform.yaml | 52 ++++++++++++++++------------------ 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 7e311e5a6..8256d7021 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -10,7 +10,6 @@ x-shared-env: &shared-api-env APP_KEY: ${SERVICE_BASE64_APIKEY} APP_DEBUG: ${APP_DEBUG:-false} APP_URL: ${SERVICE_FQDN_OPNFORM} - SELF_HOSTED: ${SELF_HOSTED:-true} LOG_CHANNEL: errorlog LOG_LEVEL: ${LOG_LEVEL:-debug} FILESYSTEM_DRIVER: ${FILESYSTEM_DRIVER:-local} @@ -50,7 +49,7 @@ x-shared-env: &shared-api-env services: opnform-api: - image: jhumanj/opnform-api:1.10.1 + image: jhumanj/opnform-api:1.10.2 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -77,7 +76,7 @@ services: start_period: 60s api-worker: - image: jhumanj/opnform-api:1.10.1 + image: jhumanj/opnform-api:1.10.2 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -98,7 +97,7 @@ services: start_period: 30s api-scheduler: - image: jhumanj/opnform-api:1.10.1 + image: jhumanj/opnform-api:1.10.2 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -122,15 +121,14 @@ services: start_period: 70s # Allow time for first scheduled run and cache write opnform-ui: - image: jhumanj/opnform-client:1.10.1 + image: jhumanj/opnform-client:1.10.2 environment: - NUXT_PUBLIC_APP_URL: ${NUXT_PUBLIC_APP_URL:-/} - NUXT_PUBLIC_API_BASE: ${NUXT_PUBLIC_API_BASE:-/api} - NUXT_PRIVATE_API_BASE: ${NUXT_PRIVATE_API_BASE:-http://nginx/api} - NUXT_PUBLIC_ENV: ${NUXT_PUBLIC_ENV:-production} - NUXT_PUBLIC_H_CAPTCHA_SITE_KEY: ${H_CAPTCHA_SITE_KEY} - NUXT_PUBLIC_RE_CAPTCHA_SITE_KEY: ${RE_CAPTCHA_SITE_KEY} - NUXT_PUBLIC_ROOT_REDIRECT_URL: ${NUXT_PUBLIC_ROOT_REDIRECT_URL} + - NUXT_PUBLIC_APP_URL=/ + - NUXT_PUBLIC_API_BASE=/api + - NUXT_PRIVATE_API_BASE=http://nginx/api + - NUXT_PUBLIC_ENV=production + - NUXT_PUBLIC_H_CAPTCHA_SITE_KEY=${H_CAPTCHA_SITE_KEY} + - NUXT_PUBLIC_RE_CAPTCHA_SITE_KEY=${RE_CAPTCHA_SITE_KEY} healthcheck: test: ["CMD-SHELL", "wget --spider -q http://opnform-ui:3000/login || exit 1"] @@ -138,15 +136,18 @@ services: timeout: 10s retries: 3 start_period: 45s + depends_on: + opnform-api: + condition: service_healthy postgresql: image: postgres:16 volumes: - opnform-postgresql-data:/var/lib/postgresql/data environment: - POSTGRES_USER: ${SERVICE_USER_POSTGRESQL} - POSTGRES_PASSWORD: ${SERVICE_PASSWORD_POSTGRESQL} - POSTGRES_DB: ${POSTGRESQL_DATABASE:-opnform} + - POSTGRES_USER=${SERVICE_USER_POSTGRESQL} + - POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL} + - POSTGRES_DB=${POSTGRESQL_DATABASE:-opnform} healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 5s @@ -156,7 +157,7 @@ services: redis: image: redis:7 environment: - REDIS_PASSWORD: ${SERVICE_PASSWORD_64_REDIS} + - REDIS_PASSWORD=${SERVICE_PASSWORD_64_REDIS} volumes: - redis-data:/data command: ["redis-server", "--requirepass", "${SERVICE_PASSWORD_64_REDIS}"] @@ -170,15 +171,17 @@ services: # used for reverse proxying the API service and Web service. nginx: image: nginx:1.29.2 + environment: + - SERVICE_URL_OPNFORM volumes: - type: bind - source: ./nginx/nginx.conf.template - target: /etc/nginx/conf.d/opnform.conf + source: ./nginx/nginx.conf + target: /etc/nginx/conf.d/default.conf read_only: true content: | - map $request_uri $api_uri { + map $original_uri $api_uri { ~^/api(/.*$) $1; - default $request_uri; + default $original_uri; } server { @@ -210,17 +213,10 @@ services: fastcgi_pass opnform-api:9000; fastcgi_index index.php; include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root/index.php; + fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/public/index.php; fastcgi_param REQUEST_URI $api_uri; } - - # Deny access to . files - location ~ /\. { - deny all; - } } - environment: - - SERVICE_FQDN_OPNFORM depends_on: - opnform-api - opnform-ui From d60e6838ab58f1680bc16084c02a32bc14dcf715 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Fri, 14 Nov 2025 10:23:37 +0000 Subject: [PATCH 09/13] Update templates/compose/opnform.yaml Co-authored-by: ShadowArcanist <162910371+ShadowArcanist@users.noreply.github.com> --- templates/compose/opnform.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 8256d7021..85126a82c 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -9,7 +9,7 @@ x-shared-env: &shared-api-env APP_ENV: production APP_KEY: ${SERVICE_BASE64_APIKEY} APP_DEBUG: ${APP_DEBUG:-false} - APP_URL: ${SERVICE_FQDN_OPNFORM} + APP_URL: ${SERVICE_FQDN_NGINX} LOG_CHANNEL: errorlog LOG_LEVEL: ${LOG_LEVEL:-debug} FILESYSTEM_DRIVER: ${FILESYSTEM_DRIVER:-local} From 671d88623e391adea2727f42ac9c19dfd7c6c468 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Fri, 14 Nov 2025 10:23:50 +0000 Subject: [PATCH 10/13] Update templates/compose/opnform.yaml Co-authored-by: ShadowArcanist <162910371+ShadowArcanist@users.noreply.github.com> --- templates/compose/opnform.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 85126a82c..71ae7c166 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -172,7 +172,7 @@ services: nginx: image: nginx:1.29.2 environment: - - SERVICE_URL_OPNFORM + - SERVICE_URL_NGINX volumes: - type: bind source: ./nginx/nginx.conf From 1126385c1baf0c3b52975d0e991b699d6fca94f0 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Fri, 14 Nov 2025 11:24:39 +0000 Subject: [PATCH 11/13] fix(opnform): update APP_URL environment variable and remove unused nginx environment variable --- templates/compose/opnform.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 71ae7c166..80624d948 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -9,7 +9,7 @@ x-shared-env: &shared-api-env APP_ENV: production APP_KEY: ${SERVICE_BASE64_APIKEY} APP_DEBUG: ${APP_DEBUG:-false} - APP_URL: ${SERVICE_FQDN_NGINX} + APP_URL: ${SERVICE_URL_NGINX} LOG_CHANNEL: errorlog LOG_LEVEL: ${LOG_LEVEL:-debug} FILESYSTEM_DRIVER: ${FILESYSTEM_DRIVER:-local} @@ -171,8 +171,6 @@ services: # used for reverse proxying the API service and Web service. nginx: image: nginx:1.29.2 - environment: - - SERVICE_URL_NGINX volumes: - type: bind source: ./nginx/nginx.conf From adc82dc7a9b96bca8560b5b9f3b1c704ed53f973 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Fri, 14 Nov 2025 14:46:56 +0000 Subject: [PATCH 12/13] feat(opnform): add SERVICE_URL_NGINX environment variable to nginx service --- templates/compose/opnform.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 80624d948..682eb38b8 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -171,6 +171,8 @@ services: # used for reverse proxying the API service and Web service. nginx: image: nginx:1.29.2 + environment: + - SERVICE_URL_NGINX volumes: - type: bind source: ./nginx/nginx.conf From 844f89f42fd9507b9c032bdb09fc350af94a5856 Mon Sep 17 00:00:00 2001 From: JhumanJ Date: Mon, 24 Nov 2025 10:12:21 +0100 Subject: [PATCH 13/13] Upgrade opnform API and UI images to version 1.12.1 in opnform.yaml --- templates/compose/opnform.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/compose/opnform.yaml b/templates/compose/opnform.yaml index 682eb38b8..8b4bbe3f5 100644 --- a/templates/compose/opnform.yaml +++ b/templates/compose/opnform.yaml @@ -49,7 +49,7 @@ x-shared-env: &shared-api-env services: opnform-api: - image: jhumanj/opnform-api:1.10.2 + image: jhumanj/opnform-api:1.12.1 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -76,7 +76,7 @@ services: start_period: 60s api-worker: - image: jhumanj/opnform-api:1.10.2 + image: jhumanj/opnform-api:1.12.1 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -97,7 +97,7 @@ services: start_period: 30s api-scheduler: - image: jhumanj/opnform-api:1.10.2 + image: jhumanj/opnform-api:1.12.1 volumes: - api-storage:/usr/share/nginx/html/storage environment: @@ -121,7 +121,7 @@ services: start_period: 70s # Allow time for first scheduled run and cache write opnform-ui: - image: jhumanj/opnform-client:1.10.2 + image: jhumanj/opnform-client:1.12.1 environment: - NUXT_PUBLIC_APP_URL=/ - NUXT_PUBLIC_API_BASE=/api