-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (80 loc) · 2.08 KB
/
docker-compose.yml
File metadata and controls
85 lines (80 loc) · 2.08 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
services:
backend-node:
build:
args:
- PORT=${PORT:-8000}
ports:
- "${PORT:-8000}:${PORT:-8000}"
environment:
- NODE_ENV=${NODE_ENV:-development}
- PORT=${PORT:-8000}
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=${DB_NAME:-nodejs_app}
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-postgres}
volumes:
- .:/app
- /app/node_modules
restart: unless-stopped
networks:
- nodejs-network
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:15-alpine
container_name: postgres-db
environment:
- POSTGRES_DB=${DB_NAME:-nodejs_app}
- POSTGRES_USER=${DB_USER:-postgres}
- POSTGRES_PASSWORD=${DB_PASSWORD:-postgres}
- POSTGRES_HOST_AUTH_METHOD=trust
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
networks:
- nodejs-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-nodejs_app}"]
interval: 10s
timeout: 5s
retries: 5
jsdoc:
image: node:20-alpine
container_name: jsdoc-server
ports:
- "${DOCS_PORT:-8001}:${DOCS_PORT:-8001}"
volumes:
- .:/app
- ./docs:/app/docs
working_dir: /app
command: >
sh -c "
npm install -g jsdoc http-server &&
jsdoc src/**/*.js -d docs --configure jsdoc.conf.json 2>/dev/null || jsdoc src/**/*.js -d docs &&
echo 'Documentation generated successfully' &&
http-server docs -p ${DOCS_PORT:-8001} -a 0.0.0.0 --proxy http://${DOMAIN:-localhost}:${DOCS_PORT:-8001}?
"
restart: unless-stopped
networks:
- nodejs-network
environment:
- DOCS_PORT=${DOCS_PORT:-8001}
adminer:
image: adminer:latest
container_name: adminer-web
ports:
- "${ADMINER_PORT:-8002}:8080"
restart: unless-stopped
networks:
- nodejs-network
depends_on:
- postgres
networks:
nodejs-network:
driver: bridge
volumes:
postgres_data: