-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
81 lines (76 loc) · 1.82 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
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
name: 'url-rotator-go'
services:
postgres:
container_name: 'rotator-postgres'
image: 'postgres:latest'
environment:
POSTGRES_USER: urlrotatorgo
POSTGRES_PASSWORD: urlrotatorgo
POSTGRES_DB: urlrotatorgo
ports:
- ":5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
url-rotator-go:
ipv4_address: 172.47.0.3
healthcheck:
test: ["CMD-SHELL", "pg_isready -q -d urlrotatorgo -U urlrotatorgo"]
interval: 10s
retries: 5
start_period: 3s
timeout: 3s
redis:
container_name: 'rotator-redis'
image: 'redis:latest'
ports:
- ":6379"
volumes:
- redis_data:/data
networks:
url-rotator-go:
ipv4_address: 172.47.0.4
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 10s
retries: 5
start_period: 3s
timeout: 3s
app:
container_name: 'url-rotator-go'
image: 'nopaleon/url-rotator-go:latest'
build:
context: .
dockerfile: Dockerfile
environment:
VP_DATABASE.POSTGRES.HOST: postgres
VP_DATABASE.POSTGRES.PORT: 5432
VP_DATABASE.POSTGRES.USER: urlrotatorgo
VP_DATABASE.POSTGRES.PASS: urlrotatorgo
VP_DATABASE.POSTGRES.DBNAME: urlrotatorgo
VP_DATABASE.REDIS.ADDR: redis:6379
VP_DATABASE.REDIS.DB: 0
VP_APP.DOMAIN: localhost
VP_APP.SCHEME: http
VP_SERVICE.HTTP.PREFORK: false
ports:
- "80:80"
networks:
url-rotator-go:
ipv4_address: 172.47.0.2
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
networks:
url-rotator-go:
ipam:
config:
- subnet: 172.47.0.0/16
volumes:
postgres_data:
driver: local
redis_data:
driver: local