-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (58 loc) · 1.52 KB
/
Copy pathdocker-compose.yml
File metadata and controls
63 lines (58 loc) · 1.52 KB
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
version: '3'
services:
frontend:
# Notes: Build image locally for any changes to be done to the image else use pre-build image from docker hub
build:
context: ./frontend
image: k8sportfolio_frontend_react_image # Custom image name
# image: baktajivan/k8sportfolio:frontend # Pre build image
ports:
- "3000:80"
networks:
- app-network
backend:
build:
context: ./backend
image: k8sportfolio_backend_flask_image # Custom image name
# image: baktajivan/k8sportfolio:backend # Pre build image
ports:
- "5000:5000"
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=k8sportfolio
- POSTGRES_USER=root
- POSTGRES_PASSWORD=password
depends_on:
- db
networks:
- app-network
nginx:
build:
context: ./nginx
image: k8sportfolio_server_nginx_image # Custom image name
# image: baktajivan/k8sportfolio:nginx # Pre build image
ports:
- "8080:80" ## Avoid conflict with XAMPP Apache on port 80
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- frontend
- backend
networks:
- app-network
db:
image: postgres:13
environment:
POSTGRES_DB: k8sportfolio
POSTGRES_USER: root
POSTGRES_PASSWORD: password
volumes:
- postgres_data:/var/lib/postgresql/data
#- ./backend/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
postgres_data: