feat: add deployment

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2023-12-27 21:12:51 +01:00
parent a093c7830d
commit aca5838d54
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
6 changed files with 66 additions and 2 deletions

View File

@ -3,6 +3,7 @@
"rust-service",
"rust-cli",
"rust-lib",
"empty"
"empty",
"deployment"
]
}

15
deployment/.config.env Normal file
View File

@ -0,0 +1,15 @@
SERVICE_HOST="0.0.0.0:3000"
AUTH_ENGINE=zitadel
ZITADEL_AUTHORITY_URL=https://%%name%%.front.kjuulh.io
ZITADEL_REDIRECT_URL=https://%%name%%.front.kjuulh.io/auth/authorized
NEF_LOGIN_RETURN_URL=https://%%name%%.front.kjuulh.io/login/return?returnUrl=/home
SESSION_BACKEND=postgresql
POSTGRES_DB=%%name%%
POSTGRES_USER=%%name%%
POSTGRESQL_USERNAME=%%name%%
POSTGRESQL_DATABASE=%%name%%
RUST_LOG=info

9
deployment/.secrets.env Normal file
View File

@ -0,0 +1,9 @@
ZITADEL_CLIENT_ID=242651043865899011@%%name%%
ZITADEL_CLIENT_SECRET=dawvPYMCWWE0yaSEItMp4IcHYCUc76Vd1j4gekU7gGr1SLX1DosuR8krN1812MPa
SESSION_POSTGRES_CONN=postgres://%%name%%:somenotverysecurepassword@postgres:5432/%%name%%
POSTGRES_PASSWORD=somenotverysecurepassword
POSTGRESQL_PASSWORD=somenotverysecurepassword
DATABASE_URL="postgres://%%name%%:somenotverysecurepassword@postgres:5432/%%name%%"

View File

@ -0,0 +1,10 @@
{
"name": "deployment",
"templating": "tera",
"delimiter": "[[]]",
"prompt": {
"name": {
"description": "Project name"
}
}
}

View File

@ -0,0 +1,26 @@
version: '3'
services:
postgres:
image: bitnami/postgresql:16
env_file:
- .config.env
- .secrets.env
labels:
logging: promtail
restart: always
ports:
- 14123:5432
volumes:
- /mnt/HC_Volume_100137529/%%name%%/data/postgres/:/bitnami/postgresql
%%name%%:
image: kasperhermansen/%%name%%:main-1701810207
command: %%name%% serve
depends_on:
- postgres
env_file:
- .config.env
- .secrets.env
labels:
logging: promtail
ports:
- 14000:3000

3
deployment/renovate.json Normal file
View File

@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}