Skip to content

Commit

Permalink
feat(service): add nocodb
Browse files Browse the repository at this point in the history
  • Loading branch information
borjapazr committed Jun 27, 2023
1 parent 63de5ba commit 3704224
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
21 changes: 21 additions & 0 deletions services/nocodb/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Volume settings ##
VOLUME_DIR=

## Domain settings ##
DOMAIN=

# Database configuration #
DB_USER=
DB_PASSWORD=
DB_NAME=

## Email settings ##
SMTP_FROM_NAME=
SMTP_FROM_ADDRESS=
SMTP_HOST=
SMTP_PORT=
SMTP_USERNAME=
SMTP_PASSWORD=

## Timezone configuration ##
TZ=
15 changes: 15 additions & 0 deletions services/nocodb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
SERVICE := nocodb
include $(ROOT_DIR)/../../core/common.mk
include .env

.ONESHELL:

.PHONY: install
install: ## Start all containers in background
@$(DOCKER_COMPOSE) up -d

.PHONY: uninstall
uninstall: ## Stop all containers and remove all data
@$(DOCKER_COMPOSE) down -v
@sudo rm -rf $(VOLUME_DIR)
68 changes: 68 additions & 0 deletions services/nocodb/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: "3.7"

services:
### NocoDB: An open source #NoCode platform that turns any database into a smart spreadsheet. ###
nocodb:
image: nocodb/nocodb:0.109.2
container_name: nocodb
restart: always
depends_on:
- nocodb-postgresql
environment:
- NC_SMTP_FROM=${SMTP_FROM_ADDRESS}
- NC_SMTP_HOST=${SMTP_HOST}
- NC_SMTP_PORT=${SMTP_PORT}
- NC_SMTP_USERNAME=${SMTP_USERNAME}
- NC_SMTP_PASSWORD=${SMTP_PASSWORD}
- NC_SMTP_SECURE=true
- NC_DB=pg://nocodb-postgresql:5432?u=${DB_USER}&p=${DB_PASSWORD}&d=${DB_NAME}
- TZ=${TZ}
volumes:
- ${VOLUME_DIR}/nocodb-data:/usr/app/data
networks:
- default
- traefik-network
labels:
## Watchtower configuration ##
- com.centurylinklabs.watchtower.enable=true
- com.centurylinklabs.watchtower.monitor-only=true

## Diun configuration ##
- diun.enable=true

## Traefik configuration ##
# Enable Traefik #
- traefik.enable=true
- traefik.docker.network=traefik-network

# Set entrypoint port #
- traefik.http.services.nocodb.loadbalancer.server.port=8080

# Set HTTP domain and HTTP -> HTTPS redirection #
- traefik.http.routers.nocodb.rule=Host(`${DOMAIN}`)
- traefik.http.routers.nocodb.entrypoints=web
- traefik.http.routers.nocodb.middlewares=https-redirect@file

# Set HTTPS domain #
- traefik.http.routers.nocodb-secure.rule=Host(`${DOMAIN}`)
- traefik.http.routers.nocodb-secure.entrypoints=websecure

### NocoDB database: PostgreSQL ###
nocodb-postgresql:
image: postgres:15
container_name: nocodb-postgresql
restart: always
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
- TZ=${TZ}
volumes:
- ${VOLUME_DIR}/nocodb-db:/var/lib/postgresql/data

networks:
default:
name: nocodb-network
traefik-network:
name: traefik-network
external: true

0 comments on commit 3704224

Please sign in to comment.