-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
85 lines (82 loc) · 2.05 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
version: '3'
volumes:
redis-dev:
networks:
external:
internal:
services:
##
# Basic Rails application build image
app: &app
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/data # mount current directory into the image
# use tmpfs for tmp and log for performance and to allow
# multiple builds in parallel. Both directories are mounted
# into the image AFTER the working directory is mounted.
tmpfs:
- /data/log
environment:
- RAILS_ENV=development
- RAILS_LOG_TO_STDOUT=1
- REDIS_HOST=redis-dev
- REDIS_PORT='6379'
- INGEST_LOCAL_PATH=/data/tmp
- BROWSEEVERYTHING_FILESYSTEM_PATH=/data/tmp
- AWS_S3_REGION=awss3region
- AWS_S3_BUCKET=awss3bucket
- AWS_S3_INGEST_BUCKET=awss3ingestbucket
- AWS_S3_APP_KEY=awss3key
- AWS_S3_APP_SECRET=awsappsecret
networks:
external:
internal:
server: &server
<<: *app
depends_on:
- redis-dev
- workers
command: bash -c "rm -f spec/dummy/tmp/pids/server.pid && bundle exec rails s -b 0.0.0.0"
expose:
- 3000
workers:
<<: *app
command: bash -c "./build/install_gems.sh && bundle exec sidekiq -r /data/spec/dummy"
depends_on:
- redis-dev
test:
<<: *app
environment:
- RAILS_ENV=test
- RAILS_LOG_TO_STDOUT=1
- REDIS_HOST=redis-test
- REDIS_PORT='6379'
- INGEST_LOCAL_PATH=/data/tmp
- BROWSEEVERYTHING_FILESYSTEM_PATH=/data/tmp
- AWS_S3_REGION=awss3region
- AWS_S3_BUCKET=awss3bucket
- AWS_S3_INGEST_BUCKET=awss3ingestbucket
- AWS_S3_APP_KEY=awss3key
- AWS_S3_APP_SECRET=awsappsecret
depends_on:
- redis-test
command: >
bash -c "rm -f spec/dummy/tmp/pids/server.pid && bundle exec rails s -e test -p 3001"
expose:
- 3001
##
# Redis queue server
redis: &redis
image: redis:4-alpine
command: redis-server
networks:
internal:
redis-dev:
<<: *redis
volumes:
- redis-dev:/data
redis-test:
<<: *redis
tmpfs: /data