-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
54 lines (50 loc) · 1.08 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
version: "3"
services:
postgres:
image: postgres:12.4
container_name: postgres
network_mode: bridge
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres-data:/var/lib/postgresql/data
expose:
- 5432
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=productdb
restart: unless-stopped
redis:
image: "redis:6-alpine"
container_name: redis
command: redis-server
network_mode: bridge
expose:
- 6379
ports:
- 6379:6379
restart: unless-stopped
go-rest-api:
image: elau/go-rest-api:latest
container_name: go-rest-api
build: .
network_mode: bridge
expose:
- 8080
ports:
- 8080:8080
environment:
- POSTGRES_DATASOURCE=postgres://postgres:postgres@postgres/productdb?sslmode=disable
- REDIS_DATASOURCE=redis:6379
command: ./main
restart: unless-stopped
depends_on:
- postgres
- redis
links:
- postgres
- redis
volumes:
postgres-data: