-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
50 lines (48 loc) · 990 Bytes
/
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
version: '3.8'
services:
web:
build: .
ports:
- "3000:3000"
env_file:
- ./env/.env
# volumes:
# - .:/usr/src/app
# command: go run cmd/main.go -b 0.0.0.0
depends_on:
- db
- cache
db:
image: postgres:15.1
restart: always
user: postgres
volumes:
- db-data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
env_file:
- ./env/db.env
# environment:
# - POSTGRES_DB=${POSTGRES_DB}
# - POSTGRES_USER=${POSTGRES_USER}
# - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
cache:
image: redis:latest
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
interval: 5s
timeout: 1s
retries: 3
volumes:
db-data:
redis-data: