-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_run.sh
executable file
·56 lines (49 loc) · 1.57 KB
/
docker_run.sh
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
#!/bin/bash
#
# Running the system (without the coffeesensor) as Docker containers.
# Before you can this script, please build the Docker images with
# ./docker_build.sh
#
# User must have access to Docker.
#
# Usage: ./docker_run.sh
#
TAG=latest
# Stopping old containers
docker stop coffee-app
docker stop coffee-service
docker stop coffee-testsensor
docker stop coffee-mosquitto
docker stop coffee-mongodb
docker rm coffee-app
docker rm coffee-service
docker rm coffee-testsensor
docker rm coffee-mosquitto
docker rm coffee-mongodb
## Additional environment parameter for the containers
# coffee-service
# -e DB_HOST=db
# -e DB_PORT=27017
# -e DATABASE=coffeeservice
# -e MQTT_URL=tcp://mqtt:1883
# -e MQTT_USER=
# -e MQTT_PASSWORD=
# -e MQTT_TRUSTSTORE=
# -e MQTT_TRUSTSTORE_PASSWORD=
# -e WEB_USER=
# -e WEB_PASSWORD=
# -e LOG_SESSIONS=false
# coffee-sensor
# -e MQTT_SERVER=mqtt
# -e MQTT_PORT=1883
# -e MQTT_USER=
# -e MQTT_PASSWORD=
# -e SSL_CA=
# coffee-app
# -e BASE_HREF=/
# Run the containers
docker run -d --name coffee-mongodb -p 27017:27017 -v coffee-mongodb-data:/data/db mongo:latest
docker run -d --name coffee-mosquitto -p 1883:1883 -v coffee-mosquitto-conf:/mosquitto/config -v coffee-mosquitto-data:/mosquitto/data -v coffee-mosquitto-log:/mosquitto/log eclipse-mosquitto:latest
docker run -d --name coffee-testsensor --link coffee-mosquitto:mqtt coffee-sensor:$TAG
docker run -d --name coffee-service -p 8080:8080 --link coffee-mongodb:db --link coffee-mosquitto:mqtt coffee-service:$TAG
docker run -d --name coffee-app --link coffee-service:apiserver -p 80:80 coffee-app:$TAG