forked from linnealovespie/baserow
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a866918e92 | |||
| 26cd26d509 | |||
| 25ed229656 | |||
| d17155f799 | |||
| 68bfb287e1 | |||
| e85291cdb6 | |||
| e61e4d9e13 | |||
| 43c7fb2130 | |||
| 48f7153a9b | |||
| d6f980ef48 | |||
| a8ae828568 | |||
| 0b930dd81d | |||
| ccba29e3e4 | |||
| 53ae1dc377 |
+1
-1
@@ -32,7 +32,7 @@ steps:
|
||||
from_secret: drone_abra-bot_token
|
||||
fork: true
|
||||
repositories:
|
||||
- coop-cloud/auto-recipes-catalogue-json
|
||||
- toolshed/auto-recipes-catalogue-json
|
||||
|
||||
trigger:
|
||||
event: tag
|
||||
|
||||
+7
-1
@@ -12,6 +12,11 @@ COMPOSE_FILE="compose.yml"
|
||||
|
||||
LETS_ENCRYPT_ENV=production
|
||||
|
||||
## For low-resource machines (<2GB ram)
|
||||
# BASEROW_AMOUNT_OF_GUNICORN_WORKERS=1
|
||||
# BASEROW_AMOUNT_OF_WORKERS=1
|
||||
# BASEROW_RUN_MINIMAL=yes
|
||||
|
||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.email.yml"
|
||||
# FROM_EMAIL="No Reply <noreply@example.com>"
|
||||
# EMAIL_SMTP_USE_TLS=true
|
||||
@@ -22,5 +27,6 @@ LETS_ENCRYPT_ENV=production
|
||||
#
|
||||
|
||||
SECRET_SECRET_KEY_VERSION=v1
|
||||
SECRET_BASEROW_JWT_SIGNING_KEY_VERSION=v1
|
||||
SECRET_JWT_KEY_VERSION=v1
|
||||
SECRET_DB_PASSWORD_VERSION=v1
|
||||
|
||||
|
||||
@@ -21,5 +21,11 @@
|
||||
* `abra app config <app-name>`
|
||||
* `abra app deploy <app-name>`
|
||||
|
||||
## Resources
|
||||
|
||||
* Baserow requires over 2GB RAM to run on Co-op Cloud with default settings
|
||||
* For environments with 2GB or less RAM, run `abra app config <app-name>` and uncomment the `For low-resource machines` config block
|
||||
* More info: https://hub.docker.com/r/baserow/baserow/#scaling-options
|
||||
|
||||
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
||||
|
||||
|
||||
+54
-7
@@ -3,18 +3,26 @@ version: "3.8"
|
||||
|
||||
services:
|
||||
app:
|
||||
image: baserow/baserow:1.31.1
|
||||
image: baserow/baserow:1.35.3
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- proxy
|
||||
- internal
|
||||
environment:
|
||||
- BASEROW_PUBLIC_URL=https://${DOMAIN}
|
||||
- SECRET_KEY_FILE=/run/secrets/secret_key
|
||||
- BASEROW_JWT_SIGNING_KEY_FILE=/run/secrets/baserow_jwt_signing_key
|
||||
- BASEROW_JWT_SIGNING_KEY_FILE=/run/secrets/jwt_key
|
||||
- BASEROW_CADDY_ADDRESSES=:80
|
||||
- BASEROW_BUILDER_DOMAINS=${WILDCARD_DOMAIN}
|
||||
- DATABASE_HOST=db
|
||||
- DATABASE_NAME=postgres
|
||||
- DATABASE_USER=postgres
|
||||
- DATABASE_PASSWORD_FILE=/run/secrets/db_password
|
||||
secrets:
|
||||
- secret_key
|
||||
- baserow_jwt_signing_key
|
||||
- jwt_key
|
||||
- db_password
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
@@ -28,28 +36,67 @@ services:
|
||||
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||
- "coop-cloud.${STACK_NAME}.version=0.7.0+1.31.1"
|
||||
- "backupbot.backup=true"
|
||||
- "backupbot.backup.path=/baserow/data"
|
||||
- "coop-cloud.${STACK_NAME}.version=1.2.0+1.35.3"
|
||||
healthcheck:
|
||||
test: ["CMD", "./baserow.sh", "backend-cmd", "backend-healthcheck"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
start_period: 1m
|
||||
|
||||
volumes:
|
||||
- baserow_data:/baserow/data
|
||||
db:
|
||||
image: postgres:15
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
|
||||
- POSTGRES_DB=postgres
|
||||
networks:
|
||||
internal:
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
labels:
|
||||
backupbot.backup.pre-hook: "/pg_backup.sh backup"
|
||||
backupbot.backup.volumes.postgres.path: "backup.sql"
|
||||
backupbot.restore.post-hook: '/pg_backup.sh restore'
|
||||
configs:
|
||||
- source: pg_backup
|
||||
target: /pg_backup.sh
|
||||
mode: 0555
|
||||
secrets:
|
||||
- db_password
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready", "-U", "postgres"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 10
|
||||
|
||||
volumes:
|
||||
baserow_data:
|
||||
postgres_data:
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
internal:
|
||||
|
||||
secrets:
|
||||
secret_key:
|
||||
external: true
|
||||
name: ${STACK_NAME}_secret_key_${SECRET_SECRET_KEY_VERSION}
|
||||
baserow_jwt_signing_key:
|
||||
jwt_key:
|
||||
external: true
|
||||
name: ${STACK_NAME}_baserow_jwt_signing_key_${SECRET_BASEROW_JWT_SIGNING_KEY_VERSION}
|
||||
name: ${STACK_NAME}_jwt_key_${SECRET_JWT_KEY_VERSION}
|
||||
db_password:
|
||||
external: true
|
||||
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
||||
|
||||
configs:
|
||||
pg_backup:
|
||||
name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION}
|
||||
file: pg_backup.sh
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
BACKUP_FILE='/var/lib/postgresql/data/backup.sql'
|
||||
|
||||
function backup {
|
||||
export PGPASSWORD=$(cat /run/secrets/db_password)
|
||||
pg_dump -U ${POSTGRES_USER} ${POSTGRES_DB} > $BACKUP_FILE
|
||||
}
|
||||
|
||||
function restore {
|
||||
cd /var/lib/postgresql/data/
|
||||
restore_config(){
|
||||
# Restore allowed connections
|
||||
cat pg_hba.conf.bak > pg_hba.conf
|
||||
su postgres -c 'pg_ctl reload'
|
||||
}
|
||||
# Don't allow any other connections than local
|
||||
cp pg_hba.conf pg_hba.conf.bak
|
||||
echo "local all all trust" > pg_hba.conf
|
||||
su postgres -c 'pg_ctl reload'
|
||||
trap restore_config EXIT INT TERM
|
||||
|
||||
# Recreate Database
|
||||
psql -U ${POSTGRES_USER} -d postgres -c "DROP DATABASE ${POSTGRES_DB} WITH (FORCE);"
|
||||
createdb -U ${POSTGRES_USER} ${POSTGRES_DB}
|
||||
psql -U ${POSTGRES_USER} -d ${POSTGRES_DB} -1 -f $BACKUP_FILE
|
||||
|
||||
trap - EXIT INT TERM
|
||||
restore_config
|
||||
}
|
||||
|
||||
$@
|
||||
@@ -0,0 +1,7 @@
|
||||
This upgrade changes the name of the jwt signing key secret from baserow_jwt_signing_key to jwt_key
|
||||
EXISTING DEPLOYMENTS MUST COPY THIS SECRET TO THE NEW LOCATION:
|
||||
# Retrieve the current jwt key value:
|
||||
docker exec <your_baserow_container_name> cat /run/secrets/baserow_jwt_signing_key
|
||||
# Create the new secret
|
||||
abra app secret insert <your_baserow_domain> jwt_key v1 <value returned by previous command>
|
||||
|
||||
Reference in New Issue
Block a user