-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
59 lines (56 loc) · 1.24 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
version: '3.8'
services:
api:
build: ./api
container_name: api_backend
restart: on-failure
ports:
- '8180:8180'
networks:
- my_network
volumes:
- ./api:/app
- /app/node_modules
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- db
environment:
- HOST_ABSOLUTE_PATH=${PWD}
- DB_HOST=db
- DB_USER=myuser
- DB_PASSWORD=mypassword
- DB_NAME=mydatabase
- JWT_SECRET=jK5q5q5KGtYJ^tj8!W@2Q~$bZ%Rj9a
# start the Docker daemon inside the container
command: sh -c "dockerd & node app.js"
client:
build: ./client
container_name: client_frontend
ports:
- '3000:3000'
networks:
- my_network
volumes:
- ./client:/app
- /app/node_modules
stdin_open: true
tty: true
db:
image: postgres:13
container_name: postgres_database
restart: always
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
networks:
- my_network
volumes:
- dbdata:/var/lib/postgresql/data
- ./database-seed.sql:/docker-entrypoint-initdb.d/database-seed.sql
volumes:
dbdata:
driver: local
networks:
my_network:
driver: bridge