-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
68 lines (67 loc) · 1.61 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
version: '3'
name: nest-kysely
services:
app:
container_name: nest-kysely-app
build:
context: .
dockerfile: ./docker/Dockerfile
target: setup
networks:
- database
ports:
- 4000:${PORT}
environment:
- NODE_ENV=${NODE_ENV}
- PORT=${PORT}
- ADMIN_TOKEN=${ADMIN_TOKEN}
- ACCESS_TOKEN_SECRET=${ACCESS_TOKEN_SECRET}
- REFRESH_TOKEN_SECRET=${REFRESH_TOKEN_SECRET}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- SENTRY_DSN=${SENTRY_DSN}
depends_on:
database:
condition: service_healthy
migrations:
condition: service_completed_successfully
migrations:
container_name: nest-kysely-migrations
build:
context: .
dockerfile: ./docker/Dockerfile
target: migrations
networks:
- database
environment:
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
depends_on:
database:
condition: service_healthy
command: ./node_modules/.bin/ts-node ./run-migrations.ts
database:
container_name: ${DB_HOST}
image: postgres
networks:
- database
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
ports:
- 5433:5432
healthcheck:
test: [ 'CMD-SHELL', 'pg_isready -U ${DB_USER} -d ${DB_NAME}' ]
interval: 10s
timeout: 5s
retries: 5
networks:
database:
driver: bridge