/
docker-compose.yml
79 lines (79 loc) · 1.9 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
version: '3.9'
services:
# docker run --name redis-cli -it --network voting-network --rm redis redis-cli -h redis
redis:
image: redis:latest
ports:
- "6379:6379"
networks:
- voting-network
rabbit:
container_name: rabbit
image: rabbitmq:3-management
ports:
- "15672:15672" # admin port
- "5672:5672" # default port
labels:
NAME: "rabbitmq"
volumes:
- ./extras/rabbitmq/enabled_plugins.txt:/etc/rabbitmq/enabled_plugins
- ./extras/rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
networks:
- voting-network
golang_api:
image: vorkurk/go-voting-app:latest
restart: on-failure
command:
- web
environment:
REDIS_HOST: redis:6379
RABBIT_HOST: amqp://rabbitmq:rabbitmq@rabbit:5672/
build:
context: src/golang
dockerfile: Dockerfile
ports:
- "8080:8080"
networks:
- voting-network
golang_worker:
image: vorkurk/go-voting-app:latest
restart: on-failure
command:
- worker
environment:
REDIS_HOST: redis:6379
RABBIT_HOST: amqp://rabbitmq:rabbitmq@rabbit:5672/
build:
context: src/golang
dockerfile: Dockerfile
networks:
- voting-network
nodejs:
image: vorkurk/nodejs-event-app:latest
restart: on-failure
ports:
- "9000:9000"
environment:
RABBIT_HOST: amqp://rabbitmq:rabbitmq@rabbit:5672/
build:
context: src/websocket
dockerfile: Dockerfile
networks:
- voting-network
ui:
restart: on-failure
image: vorkurk/react-voting-app:latest
build:
context: src/frontend
dockerfile: Dockerfile
args:
SOCKET_IO_PATH: /events/socket.io
SOCKET_IO_HOST: http://localhost:9000
API_HOST: http://localhost:8080/api
ports:
- "3000:80"
networks:
- voting-network
networks:
voting-network:
name: voting-network