This commit is contained in:
brooke 2025-04-18 13:37:31 -04:00
parent 6a933fdeeb
commit 2b537ae6bc
5 changed files with 46 additions and 8 deletions

View File

@ -17,7 +17,7 @@ DEFAULT_TIMEZONE="America/New_York"
ENABLE_RSS_FEED=True
ENABLE_PROMETHEUS_METRICS=False
#GUNICORN_WORKERS= # defaults to 6
#GUNICORN_WORKERS= # Advanced option based on the specs of your server, defaults to 6
#ALERT_MAILS = ["your_email_address", "another_email_address"] # Optional. Recieve Internal Server 500 errors. Good for debugging.

View File

@ -5,7 +5,7 @@
<!-- metadata -->
* **Category**: Apps
* **Status**: 0
* **Status**: wip
* **Image**: [`liberaforms`](https://hub.docker.com/r/liberaforms), 4, upstream
* **Healthcheck**: Yes
* **Backups**: No
@ -20,5 +20,6 @@
* `abra app new liberaforms --secrets`
* `abra app config <app-name>`
* `abra app deploy <app-name>`
* `abra app run <app-name> app /init.sh` [Create tables](https://gitlab.com/liberaforms/liberaforms/-/blob/main/docs/docker.md?ref_type=heads#create-the-database) in pgsql database
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).

View File

@ -1,2 +1,2 @@
export ENTRYPOINT_VERSION=v2
export INIT_VERSION=v1
export INIT_VERSION=v1

View File

@ -2,6 +2,7 @@
version: "3.8"
services:
app:
image: fung.uy/mycosystems/liberaforms:v4.0.0
configs:
@ -30,6 +31,7 @@ services:
LOG_DIR: /app/logs
GUNICORN_WORKERS: ${GUNICORN_WORKERS:-6}
volumes:
- app
- uploads:/app/uploads
- log:/app/logs
secrets:
@ -37,21 +39,18 @@ services:
- secret_key
- crypto_key
networks:
- proxy
- internal
deploy:
restart_policy:
condition: on-failure
labels:
- "coop-cloud.${STACK_NAME}.version="
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=5000"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "coop-cloud.${STACK_NAME}.version="
db:
image: postgres:17-alpine
image: postgres:17
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "postgres", "-U", "${POSTGRES_ROOT_USER}"]
timeout: 45s
@ -98,3 +97,7 @@ configs:
name: ${STACK_NAME}_init_${INIT_VERSION}
file: init.sh.tmpl
template_driver: golang
nginx_conf:
name: ${STACK_NAME}_nginx_conf_${NGINX_CONF_VERSION}
file: nginx.conf.tmpl
template_driver: golang

34
init.sh.tmpl Normal file
View File

@ -0,0 +1,34 @@
#!/bin/bash
set -e
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi
export "$var"="$val"
unset "$fileVar"
}
file_env "DB_PASSWORD"
file_env "CRYPTO_KEY"
file_env "SECRET_KEY"
file_env "LDAP_BIND_PASSWORD"
flask database create --docker-container db
flask database create-tables