Skip to content

Commit c3ad665

Browse files
authored
Refactor Tandoor environment and compose configuration for clarity and consistency (#293)
1 parent 9349778 commit c3ad665

2 files changed

Lines changed: 25 additions & 28 deletions

File tree

services/tandoor/.env

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,29 @@ SERVICEPORT=9001
1111
DNS_SERVER=9.9.9.9
1212

1313
# Tailscale Configuration
14+
# Generate a reusable or ephemeral auth key in the Tailscale admin console.
15+
# Do not commit a real auth key to Git.
1416
TS_AUTHKEY=
1517

16-
# Time Zone setting for containers
17-
TZ=Europe/Amsterdam # See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
18-
19-
# Optional Service variables
20-
# PUID=1000
21-
22-
# random secret key, use for example `base64 /dev/urandom | head -c50` to generate one
23-
SECRET_KEY=
24-
25-
# allowed hosts (see documentation), should be set to your hostname(s) but might be * (default) for some proxies/providers
26-
ALLOWED_HOSTS=tandoor.yourtailnet.ts.net
27-
28-
# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
18+
# Time Zone setting for containers
2919
TZ=Europe/Amsterdam
3020

31-
# Connection secret for postgres. You should change it to a random password
32-
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
33-
DB_PASSWORD=postgres
21+
# Tandoor Configuration
22+
# Generate with: base64 /dev/urandom | head -c50
23+
# Do not commit a real production secret to Git.
24+
SECRET_KEY=REPLACE_WITH_RANDOM_SECRET
25+
26+
# Allowed hosts should match your Tailscale Serve hostname.
27+
ALLOWED_HOSTS=tandoor.example.ts.net
3428

35-
# The values below this line do not need to be changed
36-
###################################################################################
37-
DB_USERNAME=postgres
38-
DB_DATABASE_NAME=tandoor
29+
# PostgreSQL Configuration
30+
DB_ENGINE=django.db.backends.postgresql
31+
POSTGRES_HOST=127.0.0.1
32+
POSTGRES_PORT=5432
33+
POSTGRES_USER=postgres
34+
POSTGRES_PASSWORD=REPLACE_WITH_RANDOM_ALPHANUMERIC_PASSWORD
35+
POSTGRES_DB=tandoor
3936

40-
#EXAMPLE_VAR="Environment varibale"
37+
# Optional Service variables
38+
# PUID=1000
39+
# PGID=1000

services/tandoor/compose.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@ services:
5353
network_mode: service:tailscale # Sidecar configuration to route ${SERVICE} through Tailscale
5454
container_name: app-${SERVICE} # Name for local container management
5555
environment:
56-
- PUID=1000
57-
- PGID=1000
5856
- TZ=${TZ}
5957
- TANDOOR_PORT=${SERVICEPORT}
6058
volumes:
61-
- ./${SERVICE}-data/staticfiles:/opt/recipes/statisfiles
59+
- ./${SERVICE}-data/staticfiles:/opt/recipes/staticfiles
6260
- ./${SERVICE}-data/mediafiles:/opt/recipes/mediafiles
6361
env_file:
6462
- ./.env
@@ -80,13 +78,13 @@ services:
8078
network_mode: service:tailscale
8179
container_name: app-${SERVICE}-database
8280
environment:
83-
POSTGRES_PASSWORD: ${DB_PASSWORD}
84-
POSTGRES_USER: ${DB_USERNAME}
85-
POSTGRES_DB: ${DB_DATABASE_NAME}
81+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
82+
POSTGRES_USER: ${POSTGRES_USER}
83+
POSTGRES_DB: ${POSTGRES_DB}
8684
volumes:
8785
- ./${SERVICE}-data/database:/var/lib/postgresql/data
8886
healthcheck:
89-
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_DATABASE_NAME}"] # Check if postgres is ready
87+
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] # Check if postgres is ready
9088
interval: 1m # How often to perform the check
9189
timeout: 10s # Time to wait for the check to succeed
9290
retries: 3 # Number of retries before marking as unhealthy

0 commit comments

Comments
 (0)