forked from smartchicago/kimball
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
54 lines (53 loc) · 1.77 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' # version of docker-compose to use
# this is good for development.
# add in the docker-compose-production.yml for nginx and letsencrypt
# only tested on a single host.
services: # configuring each container
rails:
build: .
volumes:
- '.:/app'
command: bundle exec unicorn_rails -c config/unicorn.rb -p 3000
restart: always
links:
- redis
- db
ports:
- "3000:3000"
environment:
- RAILS_ENV=${RAILS_ENV:-development}
- DATABASE_URL=${DATABASE_URL:-mysql2://patterns:patterns@db/development}
- REDIS_URL=redis://redis:6379/0
- VIRTUAL_HOST=${PRODUCTION_SERVER:-localhost}
- LETSENCRYPT_HOST=${PRODUCTION_SERVER:-localhost} # for letsencrypt
- LETSENCRYPT_EMAIL=${MAIL_ADMIN:[email protected]}
- LETSENCRYPT_TEST=${LETSENCRYPT_TEST:-true}
background:
build: .
volumes:
- '.:/app'
command: bundle exec sidekiq
restart: always
links:
- redis
- db
environment:
- RAILS_ENV=${RAILS_ENV:-development}
- DATABASE_URL=${DATABASE_URL:-mysql2://patterns:patterns@db/development}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
redis:
image: redis:alpine
restart: always
db: # name of our mysql container
image: mysql:5.7 # which image to pull, in this case specifying v. 5.7
restart: always # always restart the container after reboot
environment: # environment variables -- mysql options in this case
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: development
MYSQL_USER: patterns
MYSQL_PASSWORD: patterns
volumes: # data to map to the container
- ./databases:/docker-entrypoint-initdb.d
- db-datavolume:/var/lib/mysql # where to find our data autoimport any sql
volumes:
db-datavolume: