-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
docker-compose.yml
67 lines (61 loc) · 1.66 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:
# Our NestJS Api
api:
build:
dockerfile: Dockerfile
context: ./api
# Only build development stage from Dockerfile
target: development
# Mount our host dir to the docker container
# Mount api directory (./api) to (:) docker container (/thomas/src/app)
# Reflect File changes from host to container
volumes:
- ./api:/thomas/src/app
- /thomas/src/app/node_modules/
# RUN in debug mode: npm run start:debug --> Also start your vscode debugger
# Run in dev mode: npm run start:dev
command: npm run start:debug
depends_on:
- postgres
environment:
DATABASE_URL: postgres://user:password@postgres:5432/db
NODE_ENV: development
JWT_SECRET: hard_to_guess_secret_123
PORT: 3000
ports:
- 3000:3000
- 9229:9229
# Our Angular Frontend
frontend:
build:
dockerfile: Dockerfile
context: ./frontend
target: development
command: npm run start
volumes:
- ./frontend:/thomas/frontend/src/app
- /thomas/frontend/src/app/node_modules
ports:
- 4200:4200
links:
- api
# Our Postgres Database for NestJS to connect to
postgres:
image: postgres:10.4
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: db
ports:
- 35000:5432
# The Postgres Admin tool if we want to run some custom queries and so on against our Database
postgres_admin:
image: dpage/pgadmin4:4.28
depends_on:
- postgres
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: password
ports:
- 5050:80