-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
108 lines (103 loc) · 3.24 KB
/
Copy pathdocker-compose.yml
File metadata and controls
108 lines (103 loc) · 3.24 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
# =============================================================================
# Folo Server — One-click deploy
# Usage: docker compose up -d
# Requires: .env file at repo root (see apps/forage/.env.example)
# =============================================================================
services:
postgres:
image: postgres:17-alpine
container_name: folo-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-folo}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
POSTGRES_DB: ${POSTGRES_DB:-folo}
volumes:
- ./data/postgresql:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-folo} -d ${POSTGRES_DB:-folo}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- folo-net
redis:
image: redis:8-alpine
container_name: folo-redis
restart: unless-stopped
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:?REDIS_PASSWORD must be set} --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- ./data/redis:/data
ports:
- "${REDIS_PORT:-6379}:6379"
healthcheck:
test: ["CMD-SHELL", "REDISCLI_AUTH=${REDIS_PASSWORD} redis-cli ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- folo-net
forage:
image: jhangyu/forage:latest
build:
context: .
dockerfile: docker/forage.Dockerfile
container_name: forage
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
NODE_ENV: ${NODE_ENV:-production}
DATABASE_URL: postgresql://${POSTGRES_USER:-folo}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-folo}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
PORT: 3000
BETTER_AUTH_URL: ${BETTER_AUTH_URL:?BETTER_AUTH_URL is required}
AUTH_SECRET: ${AUTH_SECRET:?AUTH_SECRET is required}
CORS_ORIGIN: "${CORS_ORIGIN:?CORS_ORIGIN must be set},http://localhost:${WEB_PORT:-2234}"
AUTH_TRUSTED_ORIGINS: "http://localhost:${SERVER_PORT:-3000},http://localhost:${WEB_PORT:-2234}"
volumes:
- ./data/uploads:/app/uploads
ports:
- "${SERVER_PORT:-3000}:3000"
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3000/health || exit 1"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
networks:
- folo-net
folo:
image: jhangyu/folo:latest
build:
context: .
dockerfile: docker/ssr.Dockerfile
container_name: folo
restart: unless-stopped
depends_on:
forage:
condition: service_healthy
environment:
NODE_ENV: ${NODE_ENV:-production}
VITE_SELF_HOSTED: "true"
VITE_API_URL: http://forage:3000
VITE_EXTERNAL_API_URL: http://localhost:${SERVER_PORT:-3000}
VITE_WEB_URL: ${VITE_WEB_URL:-http://localhost:2234}
ports:
- "${WEB_PORT:-2234}:2234"
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:2234/ || exit 1"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
networks:
- folo-net
networks:
folo-net:
driver: bridge