-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (42 loc) · 853 Bytes
/
docker-compose.yml
File metadata and controls
46 lines (42 loc) · 853 Bytes
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
version: '3.8'
services:
app:
image: fokosun/go-rest-api:latest
container_name: app
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
volumes:
- .:/app
command: ["sh", "-c", "go mod tidy && go build -o main . && ./main"]
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=root
- DB_PASSWORD=pass
- DB_NAME=books_store
depends_on:
- db
db:
image: postgres:13
ports:
- "5432:5432"
container_name: db
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: books_store
POSTGRES_USER: root
POSTGRES_PASSWORD: pass
redis:
image: redis:latest
container_name: my_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
volumes:
db-data:
redis_data: