-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
108 lines (101 loc) · 2.98 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
version: '3.8'
services:
nginx:
image: nginx:latest
container_name: production_nginx
volumes:
- .deploy/nginx/nginx.conf:/etc/nginx/nginx.conf
- .deploy/nginx/log/:/etc/nginx/logs
- .deploy/nginx/cache/:/etc/nginx/cache
- /etc/letsencrypt/:/etc/letsencrypt/
ports:
- '8080:8080'
depends_on:
- api
links:
- api:${API_HOST:-api}
networks:
- overlay
db:
image: postgres:15-alpine
container_name: db
restart: always
environment:
POSTGRES_DB: ${DB_NAME:-ever_api_starter_kit}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASS:-ever_password}
healthcheck:
test:
[
'CMD-SHELL',
'psql postgres://$${POSTGRES_USER}:$${POSTGRES_PASSWORD}@localhost:5432/$${POSTGRES_DB} || exit 1',
]
volumes:
- postgres_data:/var/lib/postgresql/data/
- ./.deploy/db/init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh
ports:
- '5432:5432'
networks:
- overlay
redis:
image: 'redis:7.0.2-alpine'
container_name: redis
restart: always
ports:
- '6379'
networks:
- overlay
pgweb:
image: sosedoff/pgweb
container_name: pgweb
restart: always
depends_on:
- db
links:
- db:${DB_HOST:-db}
environment:
POSTGRES_DB: ${DB_NAME:-ever_api_starter_kit}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASS:-ever_password}
DATABASE_URL: postgres://${DB_USER:-postgres}:${DB_PASS:-ever_password}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-ever_api_starter_kit}?sslmode=disable
ports:
- '8081:8081'
networks:
- overlay
api:
container_name: api
image: ever-api-starter-kit-api:latest
build:
context: .
dockerfile: .deploy/api/Dockerfile
environment:
NODE_ENV: ${NODE_ENV:-development}
DB_HOST: db
SENTRY_DSN: ${SENTRY_DSN:-}
IS_NOT_SLS: 'true'
env_file:
- .env.compose
entrypoint: './entrypoint.compose.sh'
command: ['pm2-runtime', 'main.js']
restart: on-failure
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
links:
db:
condition: service_healthy
# volumes:
# - api_node_modules:/srv/ever-api-starter-kit/node_modules
ports:
- '3005:${API_PORT:-3005}'
networks:
- overlay
volumes:
# api_node_modules:
postgres_data: {}
certificates: {}
networks:
overlay:
driver: bridge