Skip to content

Commit 0589676

Browse files
committed
fixed noco not showing up
1 parent 9ca82a6 commit 0589676

File tree

4 files changed

+35
-24
lines changed

4 files changed

+35
-24
lines changed

samples/noco/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
pg_data
1+
pg_data
2+
*.log

samples/noco/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ For development, we use a local container. This can be seen in the compose.yaml
2424

2525
Title: Sailsjs
2626

27-
Short Description: A short hello world application demosntrating how to deploy Sailsjs onto defang.
27+
Short Description: A User Interface by Nocodb
2828

2929
Tags: Sailsjs
3030

samples/noco/compose.yaml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
version: "3"
21
services:
32
nocodb:
4-
image: nocodb/nocodb:0.109.7
5-
ports:
6-
- "8080:8080"
7-
environment:
8-
- NC_DB=pg
9-
- DATABASE_URL=postgresql://noco:nocodb@db:5432/nocodb
10-
- NC_AUTH_JWT_SECRET=your_jwt_secret_here
113
depends_on:
12-
db:
4+
root_db:
135
condition: service_healthy
14-
restart: always
15-
16-
db:
17-
image: postgres:13
186
environment:
19-
POSTGRES_DB: nocodb
20-
POSTGRES_USER: noco
21-
POSTGRES_PASSWORD: nocodb
7+
NC_DB: "pg://root_db:5432?u=postgres&p=password&d=root_db"
8+
image: "nocodb/nocodb:latest"
9+
ports:
10+
- target: 8080
11+
published: 8080
12+
protocol: tcp
13+
mode: ingress
14+
restart: always
2215
volumes:
23-
- ./pg_data:/var/lib/postgresql/data
16+
- "nc_data:/usr/app/data"
17+
root_db:
18+
environment:
19+
POSTGRES_DB: root_db
20+
POSTGRES_PASSWORD: password
21+
POSTGRES_USER: postgres
2422
healthcheck:
25-
test: ["CMD-SHELL", "pg_isready -U noco"]
2623
interval: 10s
27-
timeout: 5s
28-
retries: 5
29-
24+
retries: 10
25+
test: 'pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"'
26+
timeout: 2s
27+
image: postgres
28+
restart: always
29+
volumes:
30+
- "db_data:/var/lib/postgresql/data"
3031
volumes:
31-
pg_data:
32+
db_data: {}
33+
nc_data: {}

samples/noco/init.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
DO
2+
$do$
3+
BEGIN
4+
IF NOT EXISTS (SELECT FROM pg_database WHERE datname = 'nocodb') THEN
5+
CREATE DATABASE nocodb;
6+
END IF;
7+
END
8+
$do$;

0 commit comments

Comments
 (0)