-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
62 lines (59 loc) · 1.67 KB
/
docker-compose.yaml
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
services:
db:
build:
context: ./postgresql
dockerfile: Dockerfile
restart: always
env_file: .env
container_name: postgres
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- ./postgresql/postgres_data:/var/lib/postgresql/data
ports:
- '5432:5432'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 10s
timeout: 5s
retries: 5
nestjs_server:
build:
context: ./nestjs_api
dockerfile: Dockerfile
args:
- TARGET_ENV=${TARGET_ENV}
env_file:
- .env
container_name: nestjs_api
environment:
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_HOST=${POSTGRES_HOST}
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
- DISABLE_ERD=true
ports:
- '3000:3000'
depends_on:
db:
condition: service_healthy
volumes:
[]
# - .:/nestjs_api:/usr/src/app
# - ./nestjs_api/usr/src/app/node_modules:/usr/src/app/node_modules
command: /bin/sh -c "dockerize -wait tcp://db:${POSTGRES_PORT} -timeout 30s && if [ \"$$TARGET_ENV\" = \"development\" ]; then pnpm run start:dev; else dumb-init node dist/main; fi"
pgadmin:
image: dpage/pgadmin4
restart: always
container_name: nestjs_pgadmin4
env_file: .env
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
ports:
- '5050:80'
depends_on:
- db
volumes:
postgres_data: