-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathdocker-compose-example.yml
79 lines (76 loc) · 2.45 KB
/
docker-compose-example.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
# Example docker-compose file for Cog
#
# This is meant to be a minimal example of how to run Cog, connecting
# to Slack, using docker-compose. To use it, copy it to
# `docker-compose.yml` and export the variables defined in the
# `environment` stanzas below, and run
#
# docker-compose up
#
# For the sake of this example, you will need to have the following
# environment variables exported in your local environment:
#
# * SLACK_API_TOKEN
# * COG_HOST - this is not a Cog environment variable per se, but
# one specifically for this docker-compose example. You should
# set this to the host that cog can be accessed "from the
# outside". If using docker-machine, for example, you could set
# this to `docker-machine ip default`
#
# The Cog API will be available on port 80 of $COG_HOST, while
# triggers can be invoked on port 3000.
#
# For simplicity, things like Postgres credentials are hard-coded, but
# those can be modified to your taste.
#
# To see all the environment variables that affect Cog's behavior,
# please see the online documentation at
#
# * http://docs.operable.io/docs/cog-environment-variables
# * http://docs.operable.io/docs/relay-environment-variables
#
# Add the environment variables you wish to modify to the stanzas
# below (in your own `docker-compose.yml` file).
postgres:
image: postgres:9.5
environment:
- POSTGRES_USER=cog
- POSTGRES_PASSWORD=cog
cog:
image: operable/cog:0.9-dev
environment:
- DATABASE_URL=ecto://cog:cog@localhost:5432/cog
- COG_ADAPTER=slack
- SLACK_API_TOKEN=${SLACK_API_TOKEN}
- COG_MQTT_HOST=0.0.0.0
- COG_API_URL_HOST=${COG_HOST}
- COG_API_URL_PORT=80
- COG_TRIGGER_URL_HOST=${COG_HOST}
- COG_TRIGGER_URL_PORT=4001
- COG_SERVICE_URL_HOST=${COG_HOST}
- COG_SERVICE_URL_PORT=4002
- RELAY_ID=00000000-0000-0000-0000-000000000000
- RELAY_COG_TOKEN=supersecret
links:
- postgres:localhost
ports:
- 1883
- 80:4000
- 4001:4001
- 4002:4002
entrypoint: /home/operable/cog/scripts/docker-start
relay:
image: operable/relay:0.9-dev
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- RELAY_ID=00000000-0000-0000-0000-000000000000
- RELAY_COG_TOKEN=supersecret
- RELAY_COG_REFRESH_INTERVAL=30s
- RELAY_DOCKER_CLEAN_INTERVAL=1m
- RELAY_COG_HOST=localhost
- RELAY_DYNAMIC_CONFIG_ROOT=/tmp/bundle_configs
links:
- cog:localhost
entrypoint: /usr/local/bin/relay