Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions samples/nocodb/.github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Deploy
uses: DefangLabs/defang-github-action@v1.0.4
2 changes: 2 additions & 0 deletions samples/nocodb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pg_data
*.log
56 changes: 56 additions & 0 deletions samples/nocodb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# NocoDB

This sample demonstrates how to deploy a Nocodb instance with Defang. It's an open source alternative to AirTable, that makes it easy to organize and manage data.

## Prerequisites

1. Download [Defang CLI](https://github.com/DefangLabs/defang)
2. A Postgres database
3. S3 bucket and credentials, or S3 compatible alternative
4. (Optional) If you are using [Defang BYOC](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) authenticated with your AWS account
5. (Optional - for local development) [Docker CLI](https://docs.docker.com/engine/install/)

## Configuration

For this sample, you will need to provide the following [configuration](https://docs.defang.io/docs/concepts/configuration):

### `NC_DB`
Postgres database URL. NocoDB uses an odd, custom format for this. It should look like this: `pg://my.pg.hostname.com:5432?u=postgres&p=password&d=nocodb&ssl=true`. [Neon](https://neon.tech/) has a free tier and is easy to set up.

### `NC_S3_ENDPOINT`
S3 endpoint URL. [Wasabi](https://wasabi.com/) is a simple option for this if you don't already have an S3 bucket or don't have an AWS account you can use.

### `NC_S3_BUCKET_NAME`
Name of the S3 bucket.

### `NC_S3_REGION`
Region of the S3 bucket.

### `NC_S3_ACCESS_KEY`
Access key for the S3 bucket.

### `NC_S3_ACCESS_SECRET`
Access secret for the S3 bucket.

## Deploying

1. Open the terminal and type `defang login`
2. Use the deploy the configuration values specified above using the [`defang config set` command](https://docs.defang.io/docs/concepts/configuration).
2. Type `defang compose up` in the CLI.
3. Your app will be running within a few minutes.

## Development

For development, we use a local postgres container and a volume mount for file uploads. To run the app locally, just run:

`docker compose --file compose.dev.yaml up`

---

Title: NocoDB

Short Description: An open source alternative to AirTable

Tags: NocoDB

Languages: Dockerfile
24 changes: 24 additions & 0 deletions samples/nocodb/compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
services:
nocodb:
extends:
file: compose.yaml
service: nocodb
depends_on:
- postgres
environment:
NC_DB: pg://postgres:5432?u=postgres&p=password&d=nocodb
volumes:
- "nocodb_data:/usr/app/data"

postgres:
environment:
POSTGRES_DB: nocodb
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
image: postgres:12
volumes:
- "postgres_data:/var/lib/postgresql/data"

volumes:
postgres_data: {}
nocodb_data: {}
14 changes: 14 additions & 0 deletions samples/nocodb/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:
nocodb:
image: "nocodb/nocodb:0.252.0"
environment:
NC_DB:
NC_S3_ENDPOINT:
NC_S3_BUCKET_NAME:
NC_S3_REGION:
NC_S3_ACCESS_KEY:
NC_S3_ACCESS_SECRET:
ports:
- target: 8080
published: 8080
mode: ingress