-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
79 lines (73 loc) · 2.52 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: '2.2'
services:
redis:
image: redis:4
hostname: redis1
restart: unless-stopped
db:
image: mdillon/postgis:9.2
restart: unless-stopped
# persist the database between containers by storing it in a volume
volumes:
- organicityapi-postgres:/var/lib/postgresql/data
mongo:
build:
context: .
dockerfile: containers/Dockerfile-mongo
restart: unless-stopped
command: bash -c "ssh -v -i /root/.ssh/mongo_ssh_key -Ng -L 3344:0.0.0.0:27017 [email protected]"
#allow worker to inherit these settigs
app: &app_base
#stdin_open: true
#tty: true
build:
context: organicity-discovery-api
dockerfile: Dockerfile
env_file: .env
# rely on the RAILS_ENV value of the host machine
volumes:
- ./organicity-discovery-api:/organicity-discovery-api
- ./scripts:/scripts
depends_on:
- db
- redis
- mongo
restart: unless-stopped
# expose the port we configured Puma to bind to (should expose only internally)
ports:
- "3000:3000"
- "9191" # Used for Puma debugging
# expose the port we configured Puma to bind to (should expose only internally)
command: bash -c "/scripts/startup.sh"
# Worker is just a rails app like the 'app' running sidekiq, so they share Dockerfile
worker:
<<: *app_base #inherit from app
depends_on:
- app
command: bash -c "/scripts/sidekiq.sh"
ports:
- "3001:3000" #without this, worker will inherit app's port and create a conflict
web:
image: steveltn/https-portal:1
env_file: .env
environment:
#DOMAINS: 'discovery.organicity.eu -> http://app:3000'
DOMAINS: "${MY_DOMAIN}" # Takes value from .env file
STAGE: "${MY_STAGE}"
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- ./config/cors.conf:/etc/nginx/cors.conf
- ./config/shared.conf:/etc/nginx/shared.conf
- ./config/upstream.conf:/etc/nginx/conf.d/upstream.conf
# These files must go in /var/lib/nginx-conf where the erb values are converted
# Either create a specific site:
#- ./config/default.conf.erb:/var/lib/nginx-conf/discovery.organicity.eu.conf.erb:ro
#- ./config/default.ssl.conf.erb:/var/lib/nginx-conf/discovery.organicity.eu.ssl.conf.erb:ro
# OR overwrite the defaults:
- ./config/default.conf.erb:/var/lib/nginx-conf/default.conf.erb:ro
- ./config/default.ssl.conf.erb:/var/lib/nginx-conf/default.ssl.conf.erb:ro
volumes:
organicityapi-postgres: