-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (45 loc) · 947 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.1"
services:
app:
build:
dockerfile: Dockerfile
context: ./
restart: on-failure
volumes:
- ./:/APIGOLANG
ports:
- "8080:8080"
depends_on:
- database
- cache
networks:
- go_tmpl_network
database:
image: postgres:latest
restart: on-failure
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: go-db
ports:
- "5432:5432"
volumes:
- database_data:/var/lib/postgresql/data
networks:
- go_tmpl_network
cache:
image: redis:latest
restart: on-failure
command: redis-server --save 20 1 --loglevel warning --requirepass redis
ports:
- "6379:6379"
volumes:
- cache_data:/data
networks:
- go_tmpl_network
networks:
go_tmpl_network:
driver: bridge
volumes:
database_data:
cache_data: