diff --git a/.env.sample b/.env.sample index e4717eb..ff1a089 100644 --- a/.env.sample +++ b/.env.sample @@ -1,8 +1,11 @@ TYPE=nocodb -DOMAIN=nocodb.example.com +DOMAIN={{ .Domain }} ## Domain aliases #EXTRA_DOMAINS=', `www.nocodb.example.com`' LETS_ENCRYPT_ENV=production + +SECRET_DB_PASSWORD_VERSION=v1 +SECRET_NC_DB_URL_VERSION=v1 diff --git a/README.md b/README.md index 153524e..5d91d88 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # nocodb -> One line description of the recipe +> NocoDB is a no-code database platform that allows teams to collaborate and build applications with ease of a familiar and intuitive spreadsheet interface. This allows even non-developers or business users to become software creators. @@ -17,8 +17,11 @@ ## Quick start -* `abra app new nocodb --secrets` +* `abra app new nocodb` * `abra app config ` +* `export DATABASE_PW=$(pwgen 20)` +* `abra app secret insert db_password v1 ${DATABASE_PW}` +* `abra app secret insert nc_db_url v1 pg://db:5432?u=nocodb&p=${DATABASE_PW}&d=nocodb` * `abra app deploy ` For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). diff --git a/compose.yml b/compose.yml index a2c3805..870a2ca 100644 --- a/compose.yml +++ b/compose.yml @@ -3,15 +3,24 @@ version: "3.8" services: app: - image: nginx:1.20.0 + image: nocodb/nocodb:latest + secrets: + - nc_db_url networks: - proxy + - internal + environment: + DATABASE_URL_FILE: /run/secrets/nc_db_url + NC_PUBLIC_URL: https://${DOMAIN} + NC_DISABLE_TELE: "true" + volumes: + - data:/usr/app/data deploy: restart_policy: condition: on-failure labels: - "traefik.enable=true" - - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080" - "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}" @@ -20,13 +29,39 @@ services: #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - "coop-cloud.${STACK_NAME}.version=" + + db: + image: postgres:12.1-alpine + secrets: + - db_password + networks: + - internal + environment: + POSTGRES_USER: nocodb + POSTGRES_PASSWORD_FILE: /run/secrets/db_password + POSTGRES_DB: nocodb + volumes: + - db:/var/lib/postgresql/data healthcheck: - test: ["CMD", "curl", "-f", "http://localhost"] - interval: 30s - timeout: 10s + test: pg_isready -U ${DATABASE_USER} -d ${DATABASE_NAME} + interval: 10s + timeout: 2s retries: 10 - start_period: 1m + +volumes: + data: + db: + networks: proxy: external: true + internal: + +secrets: + db_password: + external: true + name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION} + nc_db_url: + external: true + name: ${STACK_NAME}_nc_db_url_${SECRET_NC_DB_URL_VERSION}