-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
131 lines (123 loc) · 3.45 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
version: "3.8"
services:
wca_registration_handler:
container_name: wca_registration_handler
build:
context: .
dockerfile: dockerfile.dev
ports:
- "8000:3000"
environment:
LOCALSTACK_ENDPOINT: "http://localstack:4566"
REDIS_URL: "redis://redis:6379"
RAILS_ENV: development
QUEUE_NAME: "registrations.fifo"
volumes:
- .:/app
- gems_volume_handler:/usr/local/bundle
tty: true
# First, install Ruby and Node dependencies
# Start the server and bind to 0.0.0.0 (vs 127.0.0.1) so Docker's port mappings work correctly
command: >
bash -c 'bundle install && yarn install && bin/rake db:seed &&
bin/rails server -b 0.0.0.0'
networks:
- wca-registration
- wca-main
depends_on:
- localstack
- redis
healthcheck:
test: curl --fail http://localhost:3000/healthcheck
dns:
# Set the DNS server to be the LocalStack container
- 10.0.2.20
wca_registration_worker:
container_name: wca_registration_worker
build:
context: .
dockerfile: dockerfile.dev
environment:
LOCALSTACK_ENDPOINT: "http://localstack:4566"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: "fake-key"
AWS_SECRET_ACCESS_KEY: "fake-access-key"
DYNAMO_REGISTRATIONS_TABLE: "registrations-development"
REGISTRATION_HISTORY_DYNAMO_TABLE: "registration-history-development"
CODE_ENVIRONMENT: "development"
QUEUE_NAME: "registrations.fifo"
REDIS_URL: "redis://redis:6379"
volumes:
- .:/app
- gems_volume_worker:/usr/local/bundle
tty: true
# First, install Ruby and Node dependencies
# Start the server and bind to 0.0.0.0 (vs 127.0.0.1) so Docker's port mappings work correctly
command: >
bash -c 'bundle install && bundle exec shoryuken -R -C config/shoryuken.yml'
networks:
- wca-registration
- wca-main
depends_on:
wca_registration_handler:
condition: service_healthy
dns:
# Set the DNS server to be the LocalStack container
- 10.0.2.20
# Emulate AWS Services Locally
localstack:
container_name: "localstack"
image: localstack/localstack
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
environment:
- LS_LOG=error
- DOCKER_HOST=unix:///var/run/docker.sock
volumes:
- "./localstack/volume:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
wca-registration:
ipv4_address: 10.0.2.20
wca-main:
dynamodb-admin:
container_name: dynamodb-admin
image: aaronshaf/dynamodb-admin
ports:
- "8001:8001"
environment:
DYNAMO_ENDPOINT: "http://localstack:4566"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: my_cool_key
AWS_SECRET_ACCESS_KEY: my_cool_secret
depends_on:
- localstack
networks:
- wca-registration
redis:
container_name: redis
image: redis:latest
ports:
- '6379:6379'
volumes:
- cache:/data
networks:
- wca-registration
volumes:
gems_volume_handler:
driver: local
gems_volume_worker:
driver: local
cache:
driver: local
networks:
wca-registration:
name: wca-registration
ipam:
config:
# Specify the subnet range for IP address allocation
- subnet: 10.0.2.0/24
wca-main:
name: wca-main
external: true