fix(docker-compose): issue with volumes, issue with database connection

This commit is contained in:
apk 2024-08-01 22:05:36 +03:00
parent 06355ff089
commit 4bf44b3275
2 changed files with 12 additions and 7 deletions

View File

@ -1,4 +1,4 @@
version: '3.9'
version: "3.9"
services:
teable:
@ -7,7 +7,7 @@ services:
ports:
- ${TEABLE_PORT}
volumes:
- teable-data:/app/.assets:rw
- teable-data:/app/.assets
# you may use a bind-mounted host directory instead,
# so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/teable/data:/app/.assets:rw
@ -39,9 +39,9 @@ services:
image: postgres:15.4
restart: always
ports:
- '42345:5432'
- "${TEABLE_DB_PORT}:${POSTGRES_PORT}"
volumes:
- teable-db:/var/lib/postgresql/data:rw
- teable-db:/var/lib/postgresql/data
# you may use a bind-mounted host directory instead,
# so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
@ -54,7 +54,11 @@ services:
- dokploy-network
- teable-standalone
healthcheck:
test: ['CMD-SHELL', "sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"]
test:
[
"CMD-SHELL",
"sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'",
]
interval: 10s
timeout: 3s
retries: 3

View File

@ -13,6 +13,7 @@ export function generate(schema: Schema): Template {
const envs = [
`TEABLE_HOST=${randomDomain}`,
"TEABLE_PORT=3000",
"TEABLE_DB_PORT=42345",
`HASH=${mainServiceHash}`,
"TIMEZONE=UTC",
"# Postgres",
@ -22,9 +23,9 @@ export function generate(schema: Schema): Template {
"POSTGRES_USER=teable",
`POSTGRES_PASSWORD=${password}`,
"# App",
"PUBLIC_ORIGIN=https://${TAEBLE_HOST}",
"PUBLIC_ORIGIN=https://${TEABLE_HOST}",
"PRISMA_DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}",
"PUBLIC_DATABASE_PROXY=127.0.0.1:42345",
"PUBLIC_DATABASE_PROXY=${TEABLE_HOST}:${TEABLE_DB_PORT}",
"# Need to support sending emails to enable the following configurations",
"# You need to modify the configuration according to the actual situation, otherwise it will not be able to send emails correctly.",
"#BACKEND_MAIL_HOST=smtp.teable.io",