-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
127 lines (122 loc) · 3.88 KB
/
Copy pathdocker-compose.yml
File metadata and controls
127 lines (122 loc) · 3.88 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
x-logging: &default-logging
driver: json-file
options:
max-size: "20m"
max-file: "5"
compress: "true"
services:
api:
image: ghcr.io/armbian/website/api:latest
build:
context: .
dockerfile: apps/api/Dockerfile
restart: unless-stopped
logging: *default-logging
environment:
- NODE_ENV=production
- PORT=3001
- DATA_SYNC_INTERVAL_MS=${DATA_SYNC_INTERVAL_MS:-14400000}
- CACHE_DIR=/app/cache
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:3000,http://localhost:8081}
- PUBLIC_API_URL=${PUBLIC_API_URL:-http://localhost:3001}
- LOG_LEVEL=${LOG_LEVEL:-info}
volumes:
- api-cache:/app/cache
- caddy-snippets:/app/shared/caddy
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:3001/api/v1/health').then(r=>{if(!r.ok)throw 1})"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
postgres:
image: postgres:17-alpine
restart: unless-stopped
logging: *default-logging
environment:
- POSTGRES_DB=${POSTGRES_DB:-payload}
- POSTGRES_USER=${POSTGRES_USER:-payload}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-payload}"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
www:
image: ghcr.io/armbian/website/www:latest
build:
context: .
dockerfile: apps/www/Dockerfile
args:
NEXT_PUBLIC_SITE_URL: ${NEXT_PUBLIC_SITE_URL:-}
NEXT_PUBLIC_DOMAIN_LOCALE_ROUTING: ${NEXT_PUBLIC_DOMAIN_LOCALE_ROUTING:-false}
NEXT_PUBLIC_PRIMARY_DOMAIN: ${NEXT_PUBLIC_PRIMARY_DOMAIN:-armbian.com}
restart: unless-stopped
logging: *default-logging
environment:
- NODE_ENV=production
- API_URL=http://api:3001
- PAYLOAD_SECRET=${PAYLOAD_SECRET:?Set PAYLOAD_SECRET in .env}
- DATABASE_URL=postgresql://${POSTGRES_USER:-payload}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-payload}
- OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-}
- OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-}
- OIDC_ISSUER_URL=${OIDC_ISSUER_URL:-}
- OIDC_ALLOWED_DOMAINS=${OIDC_ALLOWED_DOMAINS:-}
volumes:
- media-uploads:/app/apps/www/media
depends_on:
api:
condition: service_healthy
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:3000/').then(r=>{if(!r.ok)throw 1})"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
caddy:
image: caddy:2-alpine
restart: unless-stopped
logging: *default-logging
ports:
- "80:80"
- "443:443"
- "${API_HOST_PORT:-8080}:8080"
volumes:
- ./docker/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- caddy-snippets:/etc/caddy/snippets:ro
- caddy-data:/data
- caddy-config:/config
# Legacy wp-content (optional). Defaults to the empty
# legacy/wp-content placeholder bundled in the repo so nothing
# breaks when WP_CONTENT_DIR is unset.
- ${WP_CONTENT_DIR:-./legacy/wp-content}:/srv/wp-content:ro
environment:
- WWW_HOSTNAME=${WWW_HOSTNAME:-:80}
- API_HOSTNAME=${API_HOSTNAME:-:8080}
- IMAGER_HOSTNAME=${IMAGER_HOSTNAME:-:8081}
- WWW_REDIRECT_HOSTS=${WWW_REDIRECT_HOSTS:-:0}
- CADDY_EMAIL=${CADDY_EMAIL:-admin@localhost}
depends_on:
www:
condition: service_healthy
api:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:2019/config/"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
api-cache:
postgres-data:
media-uploads:
caddy-data:
caddy-config:
caddy-snippets: