-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (86 loc) · 1.99 KB
/
Copy pathdocker-compose.yml
File metadata and controls
92 lines (86 loc) · 1.99 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
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
version: '3.8'
services:
db:
image: postgres:15
container_name: hermes_db
restart: always
command: ["postgres", "-c", "timezone=${TZ:-America/Manaus}"]
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-hermes}
TZ: ${TZ:-UTC}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
redis:
image: redis:alpine
container_name: hermes_redis
restart: always
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redisdata:/data
api:
profiles: ["prod"]
build:
context: .
dockerfile: dockerfile
command: ["npm", "run", "start:api"]
container_name: hermes_api
restart: always
environment:
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-hermes}
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
PORT: 3001
env_file:
- .env
ports:
- "3001:3001"
depends_on:
- db
- redis
worker:
profiles: ["prod"]
build:
context: .
dockerfile: dockerfile
command: ["npm", "run", "start:worker"]
container_name: hermes_worker
restart: always
depends_on:
- db
- redis
env_file:
- .env
environment:
POSTGRES_HOST: db
POSTGRES_PORT: 5432
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
frontend:
profiles: ["prod"]
build:
context: ../hermes-front
dockerfile: dockerfile
args:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:3001}
container_name: hermes_front
restart: always
ports:
- "3000:3000"
depends_on:
- api
environment:
- NODE_ENV=production
volumes:
pgdata:
redisdata: