-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
99 lines (92 loc) · 2.09 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
version: "3.8"
services:
# React App - Frontend
frontend:
container_name: client
build:
context: ./client
# Uncomment this target for development build
# target: development
args:
# - NODE_ENV=development
- NODE_ENV=production
- PORT=3000
environment:
- CI=true
working_dir: /home/node/app
volumes:
- ./client/src:/home/node/app/src:ro
- /home/node/app/node_modules
depends_on:
- backend
networks:
- client-side
ports:
# Port forwarding for production app
- 3000:80
# Port forwarding for development app
# - 3000:3000
# Express Server - Backend
backend:
container_name: server
build:
context: ./server
args:
# - NODE_ENV=development
- NODE_ENV=production
- PORT=80
restart: always
env_file:
- ./.env
environment:
POSTGRES_URI: postgres://metaface:docker@db:5432/metaface
REDIS_URI: redis://redis:6379
working_dir: /home/node/app
# Uncomment command in development build to watch changes with nodemon
# command: npm run start-watch
volumes:
- ./server:/home/node/app
- backend-cache:/home/node/app/node_modules
depends_on:
- db
- redis
networks:
- client-side
- server-side
ports:
- 80:80
- 9229:9229
- 9230:9230
# Redis - Cache
redis:
image: redis:6.2.6-alpine3.14
networks:
- server-side
ports:
- 6379:6379
# PostgreSQL - Database
db:
container_name: postgres
build: ./postgres
restart: always
environment:
POSTGRES_USER: metaface
POSTGRES_PASSWORD: docker
volumes:
- pg-data:/var/lib/postgresql/data
networks:
- server-side
ports:
- 5432:5432
# Not in use currently. Need to enable docker swarm to allow secrets to work properly.
# secrets:
# pg-password:
# file: secrets/pg_password.txt
# clarifai-api:
# file: secrets/clarifai_api_key.txt
volumes:
backend-cache: {}
pg-data: {}
networks:
client-side: {}
server-side: {}