Merge pull request #746 from DrMxrcy/refactor/multiple-template-names

fix(templates): Multiple Templates Naming Schema
This commit is contained in:
Mauricio Siu 2024-11-26 22:21:47 -06:00 committed by GitHub
commit 3c072d7aa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 90 additions and 73 deletions

View File

@ -1,14 +1,13 @@
version: "3.8"
services:
mysql:
tickets-postgres:
image: mysql:8
restart: unless-stopped
hostname: mysql
networks:
- dokploy-network
volumes:
- tickets-mysql:/var/lib/mysql
- tickets-mysql-data:/var/lib/mysql
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
@ -20,23 +19,22 @@ services:
timeout: 5s
retries: 5
bot:
tickets-app:
image: eartharoid/discord-tickets:4.0.21
depends_on:
mysql:
tickets-postgres:
condition: service_healthy
restart: unless-stopped
hostname: bot
networks:
- dokploy-network
volumes:
- tickets-bot:/home/container/user
- tickets-app-data:/home/container/user
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
tty: true
stdin_open: true
environment:
DB_CONNECTION_URL: mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql/${MYSQL_DATABASE}
DB_CONNECTION_URL: mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@tickets-postgres/${MYSQL_DATABASE}
DISCORD_SECRET: ${DISCORD_SECRET}
DISCORD_TOKEN: ${DISCORD_TOKEN}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
@ -49,6 +47,10 @@ services:
PUBLISH_COMMANDS: "true"
SUPER: ${SUPER_USERS}
networks:
dokploy-network:
external: true
volumes:
tickets-mysql:
tickets-bot:
tickets-mysql-data:
tickets-app-data:

View File

@ -13,7 +13,6 @@ export function generate(schema: Schema): Template {
const mysqlUser = "tickets";
const mysqlDatabase = "tickets";
// Generate encryption key in the format they use
const encryptionKey = Array.from({ length: 48 }, () =>
Math.floor(Math.random() * 16).toString(16),
).join("");
@ -22,7 +21,7 @@ export function generate(schema: Schema): Template {
{
host: mainDomain,
port: 8169,
serviceName: "bot",
serviceName: "tickets-app",
},
];
@ -33,7 +32,6 @@ export function generate(schema: Schema): Template {
`MYSQL_ROOT_PASSWORD=${mysqlRootPassword}`,
`MYSQL_USER=${mysqlUser}`,
`ENCRYPTION_KEY=${encryptionKey}`,
// These need to be set by the user through the UI
"# Follow the guide at: https://discordtickets.app/self-hosting/installation/docker/#creating-the-discord-application",
"DISCORD_SECRET=",
"DISCORD_TOKEN=",

View File

@ -1,12 +1,12 @@
version: "3.8"
services:
invoiceshelf_db:
invoiceshelf-postgres:
image: postgres:15
networks:
- dokploy-network
volumes:
- postgres_data:/var/lib/postgresql/data
- invoiceshelf-postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_USER=${DB_USERNAME}
@ -17,13 +17,13 @@ services:
timeout: 5s
retries: 5
invoiceshelf:
invoiceshelf-app:
image: invoiceshelf/invoiceshelf:latest
networks:
- dokploy-network
volumes:
- app_data:/data
- app_conf:/conf
- invoiceshelf-app-data:/data
- invoiceshelf-app-conf:/conf
environment:
- PHP_TZ=UTC
- TIMEZONE=UTC
@ -32,7 +32,7 @@ services:
- APP_DEBUG=false
- APP_URL=http://${INVOICESHELF_HOST}
- DB_CONNECTION=pgsql
- DB_HOST=invoiceshelf_db
- DB_HOST=invoiceshelf-postgres
- DB_PORT=5432
- DB_DATABASE=${DB_DATABASE}
- DB_USERNAME=${DB_USERNAME}
@ -46,10 +46,14 @@ services:
- SANCTUM_STATEFUL_DOMAINS=${INVOICESHELF_HOST}
- STARTUP_DELAY=10
depends_on:
invoiceshelf_db:
invoiceshelf-postgres:
condition: service_healthy
networks:
dokploy-network:
external: true
volumes:
postgres_data:
app_data:
app_conf:
invoiceshelf-postgres-data:
invoiceshelf-app-data:
invoiceshelf-app-conf:

View File

@ -16,7 +16,7 @@ export function generate(schema: Schema): Template {
{
host: mainDomain,
port: 80,
serviceName: "invoiceshelf",
serviceName: "invoiceshelf-app",
},
];

View File

@ -1,13 +1,13 @@
version: "3.8"
services:
peppermint_postgres:
peppermint-postgres:
image: postgres:latest
restart: always
networks:
- dokploy-network
volumes:
- pgdata:/var/lib/postgresql/data
- peppermint-postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: peppermint
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
@ -18,19 +18,23 @@ services:
timeout: 5s
retries: 5
peppermint:
peppermint-app:
image: pepperlabs/peppermint:latest
restart: always
networks:
- dokploy-network
depends_on:
peppermint_postgres:
peppermint-postgres:
condition: service_healthy
environment:
DB_USERNAME: "peppermint"
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_HOST: "peppermint_postgres"
DB_HOST: "peppermint-postgres"
SECRET: ${SECRET}
networks:
dokploy-network:
external: true
volumes:
pgdata:
peppermint-postgres-data:

View File

@ -8,27 +8,24 @@ import {
} from "../utils";
export function generate(schema: Schema): Template {
// Generate domains and secrets
const mainDomain = generateRandomDomain(schema);
const apiDomain = generateRandomDomain(schema);
const postgresPassword = generatePassword();
const secret = generateBase64(32);
// Configure domain routing
const domains: DomainSchema[] = [
{
host: mainDomain,
port: 3000,
serviceName: "peppermint",
serviceName: "peppermint-app",
},
{
host: apiDomain,
port: 5003,
serviceName: "peppermint",
serviceName: "peppermint-app",
},
];
// Set environment variables
const envs = [
`MAIN_DOMAIN=${mainDomain}`,
`API_DOMAIN=${apiDomain}`,

View File

@ -1,7 +1,7 @@
version: "3.8"
services:
postiz:
postiz-app:
image: ghcr.io/gitroomhq/postiz-app:latest
restart: always
networks:
@ -37,7 +37,7 @@ services:
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: ${DB_NAME}
volumes:
- postgres-volume:/var/lib/postgresql/data
- postiz-postgres-data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U ${DB_USER} -d ${DB_NAME}
interval: 10s
@ -57,8 +57,12 @@ services:
volumes:
- postiz-redis-data:/data
networks:
dokploy-network:
external: true
volumes:
postgres-volume:
postiz-postgres-data:
postiz-redis-data:
postiz-config:
postiz-uploads:

View File

@ -18,7 +18,7 @@ export function generate(schema: Schema): Template {
{
host: mainDomain,
port: 5000,
serviceName: "postiz",
serviceName: "postiz-app",
},
];

View File

@ -1,26 +1,26 @@
version: "3.8"
services:
slash:
slash-app:
image: yourselfhosted/slash:latest
networks:
- dokploy-network
volumes:
- slash_data:/var/opt/slash
- slash-app-data:/var/opt/slash
environment:
- SLASH_DRIVER=postgres
- SLASH_DSN=postgresql://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME}?sslmode=disable
- SLASH_DSN=postgresql://${DB_USER}:${DB_PASSWORD}@slash-postgres:5432/${DB_NAME}?sslmode=disable
depends_on:
db:
slash-postgres:
condition: service_healthy
restart: unless-stopped
db:
slash-postgres:
image: postgres:16-alpine
networks:
- dokploy-network
volumes:
- postgres_data:/var/lib/postgresql/data
- slash-postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
@ -32,6 +32,10 @@ services:
retries: 5
restart: unless-stopped
networks:
dokploy-network:
external: true
volumes:
slash_data:
postgres_data:
slash-app-data:
slash-postgres-data:

View File

@ -16,7 +16,7 @@ export function generate(schema: Schema): Template {
{
host: mainDomain,
port: 5231,
serviceName: "slash",
serviceName: "slash-app",
},
];

View File

@ -1,12 +1,12 @@
version: "3.8"
services:
db:
windmill-postgres:
image: postgres:16
shm_size: 1g
restart: unless-stopped
volumes:
- db_data:/var/lib/postgresql/data
- windmill-postgres-data:/var/lib/postgresql/data
networks:
- dokploy-network
environment:
@ -18,7 +18,7 @@ services:
timeout: 5s
retries: 5
windmill_server:
windmill-server:
image: ghcr.io/windmill-labs/windmill:main
networks:
- dokploy-network
@ -28,12 +28,12 @@ services:
- MODE=server
- BASE_URL=http://${WINDMILL_HOST}
depends_on:
db:
windmill-postgres:
condition: service_healthy
volumes:
- worker_logs:/tmp/windmill/logs
- windmill-worker-logs:/tmp/windmill/logs
windmill_worker:
windmill-worker:
image: ghcr.io/windmill-labs/windmill:main
deploy:
replicas: 3
@ -49,14 +49,14 @@ services:
- MODE=worker
- WORKER_GROUP=default
depends_on:
db:
windmill-postgres:
condition: service_healthy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- worker_dependency_cache:/tmp/windmill/cache
- worker_logs:/tmp/windmill/logs
- windmill-worker-cache:/tmp/windmill/cache
- windmill-worker-logs:/tmp/windmill/logs
windmill_worker_native:
windmill-worker-native:
image: ghcr.io/windmill-labs/windmill:main
deploy:
replicas: 1
@ -74,20 +74,20 @@ services:
- NUM_WORKERS=8
- SLEEP_QUEUE=200
depends_on:
db:
windmill-postgres:
condition: service_healthy
volumes:
- worker_logs:/tmp/windmill/logs
- windmill-worker-logs:/tmp/windmill/logs
lsp:
windmill-lsp:
image: ghcr.io/windmill-labs/windmill-lsp:latest
restart: unless-stopped
networks:
- dokploy-network
volumes:
- lsp_cache:/root/.cache
- windmill-lsp-cache:/root/.cache
caddy:
windmill-caddy:
image: ghcr.io/windmill-labs/caddy-l4:latest
restart: unless-stopped
networks:
@ -97,11 +97,15 @@ services:
environment:
- BASE_URL=":80"
depends_on:
- windmill_server
- lsp
- windmill-server
- windmill-lsp
networks:
dokploy-network:
external: true
volumes:
db_data:
worker_dependency_cache:
worker_logs:
lsp_cache:
windmill-postgres-data:
windmill-worker-cache:
windmill-worker-logs:
windmill-lsp-cache:

View File

@ -14,14 +14,14 @@ export function generate(schema: Schema): Template {
{
host: mainDomain,
port: 80,
serviceName: "caddy",
serviceName: "windmill-caddy",
},
];
const envs = [
`WINDMILL_HOST=${mainDomain}`,
`POSTGRES_PASSWORD=${postgresPassword}`,
`DATABASE_URL=postgres://postgres:${postgresPassword}@db/windmill?sslmode=disable`,
`DATABASE_URL=postgres://postgres:${postgresPassword}@windmill-postgres/windmill?sslmode=disable`,
];
const mounts: Template["mounts"] = [
@ -29,8 +29,8 @@ export function generate(schema: Schema): Template {
filePath: "Caddyfile",
content: `:80 {
bind 0.0.0.0
reverse_proxy /ws/* http://lsp:3001
reverse_proxy /* http://windmill_server:8000
reverse_proxy /ws/* http://windmill-lsp:3001
reverse_proxy /* http://windmill-server:8000
}`,
},
];