-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
140 lines (133 loc) · 4.45 KB
/
Copy pathdocker-compose.yml
File metadata and controls
140 lines (133 loc) · 4.45 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
128
129
130
131
132
133
134
135
136
137
138
139
140
name: maian
services:
backend:
build:
context: ./Backend/backend-api
dockerfile: Dockerfile
image: ${MAIAN_BACKEND_IMAGE:-maian-backend:local}
restart: unless-stopped
env_file:
- ./Backend/backend-api/.env
environment:
APP_MODE: ${MAIAN_BACKEND_MODE:-single}
NODE_ENV: ${MAIAN_NODE_ENV:-production}
PORT: ${MAIAN_API_CONTAINER_PORT:-3000}
PM2_INSTANCES: ${MAIAN_PM2_INSTANCES:-max}
CLUSTER_INSTANCES: ${MAIAN_CLUSTER_INSTANCES:-3}
FILE_UPLOAD_DIR: ${MAIAN_FILE_UPLOAD_DIR:-uploads}
DATABASE_URL: "${MAIAN_DATABASE_URL:-postgresql://${MAIAN_POSTGRES_USER:-maian}:${MAIAN_POSTGRES_PASSWORD:-maian_dev_password}@postgres:5432/${MAIAN_POSTGRES_DB:-maian}?schema=public}"
DIRECT_URL: "${MAIAN_DIRECT_URL:-${MAIAN_DATABASE_URL:-postgresql://${MAIAN_POSTGRES_USER:-maian}:${MAIAN_POSTGRES_PASSWORD:-maian_dev_password}@postgres:5432/${MAIAN_POSTGRES_DB:-maian}?schema=public}}"
REDIS_CACHE_URL: ${MAIAN_REDIS_CACHE_URL:-redis://redis-cache:6379}
REDIS_BULL_URL: ${MAIAN_REDIS_BULL_URL:-redis://redis-bull:6379}
ports:
- "${MAIAN_API_HOST_PORT:-${MAIAN_API_PORT:-3000}}:${MAIAN_API_CONTAINER_PORT:-3000}"
depends_on:
postgres:
condition: service_healthy
required: false
redis-cache:
condition: service_healthy
required: false
redis-bull:
condition: service_healthy
required: false
volumes:
- backend-uploads:/app/uploads
- backend-logs:/app/logs
networks:
- maian-network
postgres:
image: postgres:17
profiles:
- postgres
- local-infra
restart: unless-stopped
environment:
POSTGRES_DB: ${MAIAN_POSTGRES_DB:-maian}
POSTGRES_USER: ${MAIAN_POSTGRES_USER:-maian}
POSTGRES_PASSWORD: ${MAIAN_POSTGRES_PASSWORD:-maian_dev_password}
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "${MAIAN_POSTGRES_HOST_PORT:-5432}:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./Base_de_datos/schema.sql:/docker-entrypoint-initdb.d/00-schema.sql:ro
- ./Base_de_datos/currencies_rows.sql:/docker-entrypoint-initdb.d/10-currencies_rows.sql:ro
- ./Base_de_datos/countries_rows.sql:/docker-entrypoint-initdb.d/20-countries_rows.sql:ro
- ./Base_de_datos/provinces_rows.sql:/docker-entrypoint-initdb.d/30-provinces_rows.sql:ro
- ./Base_de_datos/cities_rows.sql:/docker-entrypoint-initdb.d/40-cities_rows.sql:ro
- ./Base_de_datos/categories_rows.sql:/docker-entrypoint-initdb.d/50-categories_rows.sql:ro
- ./Base_de_datos/category_translations_rows.sql:/docker-entrypoint-initdb.d/60-category_translations_rows.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
networks:
- maian-network
redis-cache:
image: redis:7-alpine
profiles:
- redis
- local-infra
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
ports:
- "${MAIAN_REDIS_CACHE_HOST_PORT:-6379}:6379"
volumes:
- redis-cache-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
start_period: 5s
networks:
- maian-network
redis-bull:
image: redis:7-alpine
profiles:
- redis
- local-infra
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
ports:
- "${MAIAN_REDIS_BULL_HOST_PORT:-6380}:6379"
volumes:
- redis-bull-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
start_period: 5s
networks:
- maian-network
cloudflared:
image: cloudflare/cloudflared:latest
profiles:
- cloudflared
restart: unless-stopped
command: tunnel --no-autoupdate run ${TUNNEL_ID:-}
env_file:
- ./.env
volumes:
- ./cloudflared/config.yml:/etc/cloudflared/config.yml:ro
- ./cloudflared/${TUNNEL_ID:-missing-tunnel-id}.json:/etc/cloudflared/${TUNNEL_ID:-missing-tunnel-id}.json:ro
ports:
- "${MAIAN_CLOUDFLARED_METRICS_PORT:-${METRICS_PORT:-2000}}:2000"
depends_on:
backend:
condition: service_started
networks:
- maian-network
networks:
maian-network:
driver: bridge
volumes:
backend-logs:
backend-uploads:
postgres-data:
redis-bull-data:
redis-cache-data: