-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
152 lines (142 loc) · 3.87 KB
/
docker-compose.yml
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
version: '3.6'
x-project-name: &project-name ${COMPOSE_PROJECT_NAME:-projectx}
# Define common service settings to reduce duplication
x-service-common: &service-common
env_file: .env
networks:
- default
depends_on:
db:
condition: service_healthy
temporal:
condition: service_started
environment:
- NX_DISABLE_DB=true
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- /app/libs/frontend
- /app/node_modules
services:
db:
image: postgis/postgis:17-3.5
container_name: ${COMPOSE_PROJECT_NAME:-projectx}-db
restart: always
networks:
- default
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_DB: ${POSTGRES_DB}
PGDATA: /var/lib/postgresql/data/pgdata # Explicit PGDATA path
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 2s # Added start period
labels:
- "com.*project-name.service=database"
expose:
- "${POSTGRES_PORT:-5432}"
tmpfs:
- /tmp
- /run
- /run/postgresql
temporal:
image: temporalio/auto-setup:1.24.3.0
container_name: ${COMPOSE_PROJECT_NAME:-projectx}-temporal
depends_on:
db:
condition: service_healthy
environment:
- DB=postgres12
- DB_PORT=${POSTGRES_PORT:-5432}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PWD=${POSTGRES_PASSWORD}
- POSTGRES_SEEDS=db
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml
volumes:
- ./deployment/config/dynamicconfig:/etc/temporal/config/dynamicconfig
ports:
- "${TEMPORAL_PORT:-7233}:7233"
labels:
- "com.*project-name.service=temporal"
expose:
- "${TEMPORAL_PORT:-7233}"
temporal-admin-tools:
image: temporalio/admin-tools:1.25.1-tctl-1.18.1-cli-1.1.1
container_name: ${COMPOSE_PROJECT_NAME:-projectx}-temporal-admin-tools
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:${TEMPORAL_PORT:-7233}
- TEMPORAL_CLI_ADDRESS=temporal:${TEMPORAL_PORT:-7233}
- TEMPORAL_CLI_SHOW_STACKS=1
stdin_open: true
tty: true
labels:
- "com.*project-name.service=temporal-admin-tools"
volumes:
- ./deployment/scripts/search-attributes.sh:/etc/temporal/entrypoint.sh
entrypoint: >
/bin/sh -c "
chmod +x /etc/temporal/entrypoint.sh &&
/etc/temporal/entrypoint.sh &&
exec /bin/bash
"
temporal-ui:
image: temporalio/ui:2.31.2
container_name: ${COMPOSE_PROJECT_NAME:-projectx}-temporal-ui
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:${TEMPORAL_PORT:-7233}
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
ports:
- "${TEMPORAL_UI_PORT:-8080}:8080"
labels:
- "com.*project-name.service=temporal-ui"
expose:
- "${TEMPORAL_UI_PORT:-8080}"
# PROJECTX SERVICES
auth:
<<: *service-common
container_name: auth
command: >
bash -c "
npm run prisma:generate &&
npm run prisma:migrate &&
npx nx reset &&
npm run dev:auth
"
ports:
- "${AUTH_PORT:-9095}:${AUTH_PORT:-9095}"
- 9229:9229
order:
<<: *service-common
container_name: order
command: >
bash -c "
npm run prisma:generate &&
npm run prisma:migrate &&
npx nx reset &&
npm run dev:order
"
ports:
- "${ORDER_PORT:-9096}:${ORDER_PORT:-9096}"
- 9230:9230
networks:
default:
name: ${COMPOSE_PROJECT_NAME:-projectx}-network
driver: bridge
volumes:
postgres_data:
name: ${COMPOSE_PROJECT_NAME:-projectx}-postgres-data