-
Notifications
You must be signed in to change notification settings - Fork 439
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
70 lines (67 loc) · 2.48 KB
/
Copy pathdocker-compose.yml
File metadata and controls
70 lines (67 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
# Override all four variables together when changing credentials —
# compose cannot derive DATABASE_URL from POSTGRES_* via variable nesting.
POSTGRES_USER: ${POSTGRES_USER:-tokscale}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-tokscale}
POSTGRES_DB: ${POSTGRES_DB:-tokscale}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
# Bound to loopback only — not exposed on all interfaces.
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-tokscale} -d ${POSTGRES_DB:-tokscale}"]
interval: 5s
timeout: 5s
retries: 10
app:
# Use the image built by `make docker/build` (tagged tokscale:latest).
# Declaring `image` here prevents compose from triggering an implicit build
# on `make up`, which would fail because `db` is only resolvable inside the
# compose network — not from the Docker build context.
image: tokscale:latest
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql://tokscale:tokscale@db:5432/tokscale}
# postgres:16-alpine has no TLS configured. Production deployments using
# a managed database should set DATABASE_SSL=require (the default outside
# this Compose stack also remains require in NODE_ENV=production).
DATABASE_SSL: ${DATABASE_SSL:-false}
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID:-}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET:-}
APP_URL: ${APP_URL:-http://localhost:3333}
# CSRF_ALLOWED_ORIGINS: ${CSRF_ALLOWED_ORIGINS}
ports:
- "127.0.0.1:3333:3000"
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:3000/ || exit 1"]
interval: 5s
timeout: 5s
retries: 12
tui:
build:
context: .
dockerfile: Dockerfile.tui
profiles: [tui]
stdin_open: true
tty: true
user: "${TOKSCALE_UID:-1000}:${TOKSCALE_GID:-1000}"
environment:
HOME: /home/tokscale
volumes:
# These are the only writable mounts: the CLI's own settings and cache.
# `make tui` creates them as the invoking host user before Compose starts.
- ${HOME}/.config/tokscale:/home/tokscale/.config/tokscale
- ${HOME}/.cache/tokscale:/home/tokscale/.cache/tokscale
volumes:
postgres_data: