-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#docker-compose -f ./RPi/Z_IoT/DHT-to-MongoDB/Ansible_py_dht_mongo_arm64.yml up -d | ||
#docker-compose -f ./Ansible_py_dht_mongo_arm64.yml up -d | ||
|
||
version: '3' | ||
services: | ||
mongodb: | ||
image: mongo:latest #apcheamitru/arm32v7-mongo | ||
container_name: mongodb | ||
environment: | ||
MONGO_INITDB_ROOT_USERNAME: yourusername | ||
MONGO_INITDB_ROOT_PASSWORD: yourpassword | ||
MONGO_INITDB_DATABASE: sensor_data | ||
volumes: | ||
- mongodb_data:/data/db | ||
ports: | ||
- "27017:27017" | ||
restart: always | ||
|
||
|
||
dht_sensor_mongo: | ||
build: | ||
context: . #./Python2MongoDB.py #./path/to/your/python/code | ||
dockerfile: Dockerfile | ||
container_name: dht_sensor_mongo | ||
depends_on: | ||
- mongodb | ||
# networks: | ||
# - mynetwork | ||
environment: | ||
MONGODB_HOST: mongodb | ||
MONGODB_PORT: 27017 # Specify the MongoDB port | ||
MONGO_INITDB_ROOT_USERNAME: yourusername # Specify the MongoDB root username | ||
MONGO_INITDB_ROOT_PASSWORD: yourpassword # Specify the MongoDB root password | ||
MONGO_DB_NAME: sensor_data # Specify the MongoDB database name | ||
MONGO_COLLECTION_NAME: dht_sensor # Specify the MongoDB collection name | ||
DHT_SENSOR_TYPE: DHT22 # Set the DHT sensor type here (DHT11 or DHT22) | ||
#DHT_PIN: 4 # Set the DHT sensor pin here | ||
privileged: true | ||
command: python3 PyToMongoDB.py | ||
#command: tail -f /dev/null #keep it running | ||
|
||
volumes: | ||
mongodb_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters