working
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
TYPE=baserow
|
||||
TYPE=formio
|
||||
|
||||
DOMAIN=baserow.example.com
|
||||
DOMAIN=formio.example.com
|
||||
|
||||
COMPOSE_FILE="compose.yml"
|
||||
|
||||
@ -13,3 +13,5 @@ COMPOSE_FILE="compose.yml"
|
||||
LETS_ENCRYPT_ENV=production
|
||||
|
||||
ROOT_EMAIL="admin@example.com"
|
||||
SECRET_ROOT_PASS_VERSION=v1
|
||||
SECRET_MONGO_PASS_VERSION=v1
|
||||
2
abra.sh
2
abra.sh
@ -1 +1 @@
|
||||
export PG_BACKUP_CONFIG_VERSION=v1
|
||||
export CUSTOM_ENTRYPOINT_VERSION=v1
|
||||
32
compose.yml
32
compose.yml
@ -9,10 +9,11 @@ services:
|
||||
- internal
|
||||
environment:
|
||||
DEBUG: formio:*
|
||||
NODE_CONFIG: '{"mongo": "mongodb://mongo:27017/formio"}'
|
||||
ROOT_PASSWORD_FILE: annoying
|
||||
# NODE_CONFIG: '{"mongo": "mongodb://mongo:27017/formio"}'
|
||||
ROOT_PASSWORD_FILE: "/run/secrets/root_pass"
|
||||
secrets:
|
||||
- root_pass
|
||||
- mongo_pass
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
@ -39,10 +40,12 @@ services:
|
||||
# retries: 10
|
||||
# start_period: 1m
|
||||
configs:
|
||||
- source: backup-postgres
|
||||
target: /backup.sh
|
||||
- source: custom-entrypoint
|
||||
target: /custom-entrypoint.sh
|
||||
mode: 0777
|
||||
mongodb:
|
||||
entrypoint: /custom-entrypoint.sh
|
||||
|
||||
mongo:
|
||||
image: mongo:8.2.6
|
||||
networks:
|
||||
- internal
|
||||
@ -51,18 +54,29 @@ services:
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: "root"
|
||||
MONGO_INITDB_ROOT_PASSWORD_FILE: "/run/secrets/mongo_pass"
|
||||
MONGO_INITDB_DATABASE: formio
|
||||
configs:
|
||||
- source: mongo-init
|
||||
target: /docker-entrypoint-initdb.d/mongo-init.js
|
||||
mode: 0777
|
||||
secrets:
|
||||
- mongo_pass
|
||||
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
configs:
|
||||
backup-postgres:
|
||||
name: backup-postgres_${PG_BACKUP_CONFIG_VERSION}
|
||||
file: ./backup-postgres.sh
|
||||
custom-entrypoint:
|
||||
name: custom-entrypoint_${CUSTOM_ENTRYPOINT_VERSION}
|
||||
file: ./custom-entrypoint.sh.tmpl
|
||||
template_driver: golang
|
||||
mongo-init:
|
||||
name: mongo-init_${MONGO-INIT_VERSION}
|
||||
file: ./mongo-init.js.tmpl
|
||||
template_driver: golang
|
||||
|
||||
networks:
|
||||
internal:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
|
||||
7
custom-entrypoint.sh.tmpl
Normal file
7
custom-entrypoint.sh.tmpl
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
export ROOT_PASSWORD=`cat $ROOT_PASSWORD_FILE`
|
||||
export NODE_CONFIG='{
|
||||
"mongo": "mongodb://formio:{{ secret "mongo_pass" }}@mongo:27017/formio",
|
||||
"port": 3001
|
||||
}'
|
||||
/usr/local/bin/docker-entrypoint.sh --no-node-snapshot main
|
||||
12
mongo-init.js.tmpl
Normal file
12
mongo-init.js.tmpl
Normal file
@ -0,0 +1,12 @@
|
||||
db.createUser(
|
||||
{
|
||||
user: "formio",
|
||||
pwd: "{{ secret "mongo_pass" }}",
|
||||
roles: [
|
||||
{
|
||||
role: "readWrite",
|
||||
db: "formio"
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user