Skip to content

Commit

Permalink
Add Docker .env for ports
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Sep 27, 2019
1 parent 0165714 commit 9e206f7
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 28 deletions.
16 changes: 16 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Orion variables
ORION_PORT=1026
ORION_VERSION=2.2.0

# MongoDB variables
MONGO_DB_PORT=27017
MONGO_DB_VERSION=3.6

# IoT Agent Ultralight Variables
ULTRALIGHT_VERSION=1.9.0
IOTA_NORTH_PORT=4041
IOTA_SOUTH_PORT=7896

# Tutorial variables
TUTORIAL_APP_PORT=3000
TUTORIAL_DUMMY_DEVICE_PORT=3001
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ jspm_packages/
.npm
.eslintcache
*.tgz
.env
.next
54 changes: 27 additions & 27 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,53 +20,53 @@ version: "3.5"
services:
# Orion is the context broker
orion:
image: fiware/orion:2.2.0
image: fiware/orion:${ORION_VERSION}
hostname: orion
container_name: fiware-orion
depends_on:
- mongo-db
networks:
- default
expose:
- "1026"
- "${ORION_PORT}"
ports:
- "1026:1026"
- "${ORION_PORT}:${ORION_PORT}" # localhost:1026
command: -dbhost mongo-db -logLevel DEBUG
healthcheck:
test: curl --fail -s http://orion:1026/version || exit 1
test: curl --fail -s http://orion:${ORION_PORT}/version || exit 1

# IoT-Agent is configured for the UltraLight Protocol
iot-agent:
image: fiware/iotagent-ul:1.9.0
image: fiware/iotagent-ul:${ULTRALIGHT_VERSION}
hostname: iot-agent
container_name: fiware-iot-agent
depends_on:
- mongo-db
networks:
- default
expose:
- "4041"
- "7896"
- "${IOTA_NORTH_PORT}"
- "${IOTA_SOUTH_PORT}"
ports:
- "4041:4041"
- "7896:7896"
- "${IOTA_NORTH_PORT}:${IOTA_NORTH_PORT}" # localhost:4041
- "${IOTA_SOUTH_PORT}:${IOTA_SOUTH_PORT}" # localhost:7896
environment:
- IOTA_CB_HOST=orion # name of the context broker to update context
- IOTA_CB_PORT=1026 # port the context broker listens on to update context
- IOTA_NORTH_PORT=4041
- IOTA_CB_PORT=${ORION_PORT} # port the context broker listens on to update context
- IOTA_NORTH_PORT=${IOTA_NORTH_PORT}
- IOTA_REGISTRY_TYPE=mongodb #Whether to hold IoT device info in memory or in a database
- IOTA_LOG_LEVEL=DEBUG # The log level of the IoT Agent
- IOTA_TIMESTAMP=true # Supply timestamp information with each measurement
- IOTA_CB_NGSI_VERSION=v2 # use NGSIv2 when sending updates for active attributes
- IOTA_AUTOCAST=true # Ensure Ultralight number values are read as numbers not strings
- IOTA_MONGO_HOST=mongo-db # The host name of MongoDB
- IOTA_MONGO_PORT=27017 # The port mongoDB is listening on
- IOTA_MONGO_PORT=${MONGO_DB_PORT} # The port mongoDB is listening on
- IOTA_MONGO_DB=iotagentul # The name of the database used in mongoDB
- IOTA_HTTP_PORT=7896 # The port used for device traffic over HTTP
- IOTA_PROVIDER_URL=http://iot-agent:4041
- IOTA_HTTP_PORT=${IOTA_SOUTH_PORT} # The port used for device traffic over HTTP
- IOTA_PROVIDER_URL=http://iot-agent:${IOTA_NORTH_PORT}
- IOTA_DEFAULT_RESOURCE=/iot/d
healthcheck:
test: curl --fail -s http://iot-agent:4041/iot/about || exit 1
test: curl --fail -s http://iot-agent:${IOTA_NORTH_PORT}/iot/about || exit 1

# Tutorial acts as a series of dummy IoT Sensors over HTTP
tutorial:
Expand All @@ -82,34 +82,34 @@ services:
- iot-sensors
- context-provider
expose:
- "3000"
- "3001"
- "${TUTORIAL_APP_PORT}"
- "${TUTORIAL_DUMMY_DEVICE_PORT}"
ports:
- "3000:3000"
- "3001:3001"
- "${TUTORIAL_APP_PORT}:${TUTORIAL_APP_PORT}" # localhost:3000
- "${TUTORIAL_DUMMY_DEVICE_PORT}:${TUTORIAL_DUMMY_DEVICE_PORT}" # localhost:3001
environment:
- "DEBUG=tutorial:*"
- "WEB_APP_PORT=3000" # Port used by the content provider proxy and web-app for viewing data
- "WEB_APP_PORT=${TUTORIAL_APP_PORT}" # Port used by the content provider proxy and web-app for viewing data
- "IOTA_HTTP_HOST=iot-agent"
- "IOTA_HTTP_PORT=7896"
- "DUMMY_DEVICES_PORT=3001" # Port used by the dummy IOT devices to receive commands
- "IOTA_HTTP_PORT=${IOTA_SOUTH_PORT}"
- "DUMMY_DEVICES_PORT=${TUTORIAL_DUMMY_DEVICE_PORT}" # Port used by the dummy IOT devices to receive commands
- "DUMMY_DEVICES_TRANSPORT=HTTP" # Default transport used by dummy Io devices
- "DUMMY_DEVICES_API_KEY=4jggokgpepnvsb2uv4s40d59ov"
- "CONTEXT_BROKER=http://orion:1026/v2" # URL of the context broker to update context
- "CONTEXT_BROKER=http://orion:${ORION_PORT}/v2" # URL of the context broker to update context
- "OPENWEATHERMAP_KEY_ID=<ADD_YOUR_KEY_ID>"
- "TWITTER_CONSUMER_KEY=<ADD_YOUR_CONSUMER_KEY>"
- "TWITTER_CONSUMER_SECRET=<ADD_YOUR_CONSUMER_SECRET>"
healthcheck:
test: curl --fail -s http://tutorial:3000/version || exit 1
test: curl --fail -s http://tutorial:${TUTORIAL_APP_PORT}/version || exit 1
# Database
mongo-db:
image: mongo:3.6
image: mongo:${MONGO_DB_VERSION}
hostname: mongo-db
container_name: db-mongo
expose:
- "27017"
- "${MONGO_DB_PORT}"
ports:
- "27017:27017"
- "${MONGO_DB_PORT}:${MONGO_DB_PORT}" # localhost:27017
networks:
- default
command: --bind_ip_all --smallfiles
Expand Down

0 comments on commit 9e206f7

Please sign in to comment.