-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
65 lines (61 loc) · 1.64 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
version: "3.8"
services:
# NestJs API
nestjs-api:
build:
dockerfile: Dockerfile
context: ./nestjs-api
# Only build development stage from Dockerfile
target: development
# Mount host dir to the docker container
# Mount nestjs-api directory (./nestjs-api) to (:) docker container (/myapps/src/app)
# Reflect File changes from host to container
volumes:
- ./nestjs-api:/myapps/src/app
- /myapps/src/app/node_modules/
# RUN in debug mode: npm run start:debug --> Also start your editor/IDE debugger
# RUN in dev mode: npm run start:dev
command: npm run start:dev
depends_on:
- postgres
environment:
DATAB ASE_URL: postgres://user:password@postgres:5432/db
NODE_ENV: development
JWT_SECRET: hard_to_guess_secret_123
PORT: 5000
ports:
- 5000:5000
- 9229:9229
# Angular SPA
angular-spa:
build:
dockerfile: Dockerfile
context: ./angular-spa
target: development
command: npm run start
volumes:
- ./angular-spa:/myapps/angular-app/src/app
- /myapps/angular-spa/src/app/nodemodules
ports:
- 4200:4200
links:
- nestjs-api
# postgres Database for NestJs
postgres:
image: postgres:latest
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: db
ports:
- 35000:5432
# Postgres Admin tool if we want to run some custom queries
postgres-admin:
image: dpage/pgadmin4
depends_on:
- postgres
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: password
ports:
- 5050:80