-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
185 lines (177 loc) · 4.62 KB
/
docker-compose.yml
File metadata and controls
185 lines (177 loc) · 4.62 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
services:
# Development Backend
backend:
build:
context: .
dockerfile: Dockerfile
target: dev
container_name: promata-backend
environment:
- NODE_ENV=development
- PORT=${BACKEND_PORT:-3000}
- DATABASE_URL=${DATABASE_URL}
- CHOKIDAR_USEPOLLING=true
- UMAMI_URL=${UMAMI_URL}
- UMAMI_WEBSITE_ID=${UMAMI_WEBSITE_ID}
- MAIL_HOST=${MAIL_HOST}
- MAIL_PORT=${MAIL_PORT}
- MAIL_USER=${MAIL_USER}
- MAIL_PASS=${MAIL_PASS}
- MAIL_FROM=${MAIL_FROM}
- MAIL_FROM_NAME=${MAIL_FROM_NAME}
ports:
- ${BACKEND_PORT:-3000}:${BACKEND_PORT:-3000}
volumes:
- .:/app
- backend_node_modules:/app/node_modules
- /app/generated
networks:
- promata_dev
depends_on:
database:
condition: service_healthy
restart: unless-stopped
command: sh -c "npx prisma migrate dev && npm run start:dev"
healthcheck:
test: ["CMD", "curl", "-f", "${BACKEND_DEV_HEALTHCHECK_URL:-http://localhost:3000/health}"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
metabase:
image: metabase/metabase:latest
container_name: promata-metabase
ports:
- "3001:3000"
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: metabase
MB_DB_PORT: 5432
MB_DB_USER: metabase
MB_DB_PASS: metabase123
MB_DB_HOST: metabase-db
depends_on:
metabase-db:
condition: service_healthy
restart: always
networks:
- promata_dev
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3000 || exit 1"]
interval: 30s
timeout: 10s
retries: 5
# Metabase Database
metabase-db:
image: postgres:15-alpine
container_name: promata-metabase-db
ports:
- "5052:5432"
environment:
POSTGRES_DB: metabase
POSTGRES_USER: metabase
POSTGRES_PASSWORD: metabase123
volumes:
- metabase-db-data:/var/lib/postgresql/data
restart: always
networks:
- promata_dev
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
# Database para desenvolvimento
database:
image: postgres:15-alpine
container_name: promata-database
environment:
- POSTGRES_DB=${POSTGRES_DB:-promata}
- POSTGRES_USER=${POSTGRES_USER:-promata}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-promata123}
ports:
- "${DATABASE_PORT_MAPPING:-5432:5432}"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./prisma/migrations:/docker-entrypoint-initdb.d
networks:
- promata_dev
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-promata}"]
interval: 10s
timeout: 5s
retries: 5
# Umami Analytics
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
container_name: promata-umami
ports:
- "5050:3000"
environment:
DATABASE_URL: postgresql://umami:umami@umami-db:5432/umami
DATABASE_TYPE: postgresql
depends_on:
umami-db:
condition: service_healthy
init: true
restart: always
networks:
- promata_dev
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
interval: 5s
timeout: 5s
retries: 5
# Umami Database
umami-db:
image: postgres:15-alpine
container_name: promata-umami-db
ports:
- "5051:5432"
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: umami
volumes:
- umami-db-data:/var/lib/postgresql/data
restart: always
networks:
- promata_dev
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
# Prisma Studio
prisma-studio:
image: node:18-alpine
container_name: promata-prisma-studio
ports:
- "5555:5555"
environment:
- DATABASE_URL=${DATABASE_URL}
volumes:
- .:/app
- backend_node_modules:/app/node_modules
working_dir: /app
command: sh -c "npx prisma migrate deploy && npx prisma studio --hostname 0.0.0.0 --port 5555"
depends_on:
database:
condition: service_healthy
networks:
- promata_dev
restart: unless-stopped
volumes:
backend_node_modules:
name: promata-backend-node-modules
postgres_data:
name: promata-postgres-data
metabase-db-data:
name: promata-metabase-db-data
umami-db-data:
name: promata-umami-db-data
networks:
promata_dev:
name: promata-network-dev
driver: bridge