summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.env.example4
-rw-r--r--compose.yaml24
-rw-r--r--database/create_table.sql6
-rw-r--r--mosquitto-config/mosquitto.conf4
4 files changed, 34 insertions, 4 deletions
diff --git a/.env.example b/.env.example
index dee33a5..94f8f32 100644
--- a/.env.example
+++ b/.env.example
@@ -1,6 +1,6 @@
# vim:ft=sh
# Usuário que o cliente MQTT utilizará para logar
-MQTT_CLIENT_USER="changeme"
+MQTT_CLIENT_USER="tester"
# Senha que o cliente MQTT utilizará para logar
-MQTT_CLIENT_PASSWORD="changeme"
+MQTT_CLIENT_PASSWORD="rosebud"
diff --git a/compose.yaml b/compose.yaml
index db32d4c..21f3cea 100644
--- a/compose.yaml
+++ b/compose.yaml
@@ -30,5 +30,29 @@ services:
depends_on:
- mosquitto
+
+ postgres:
+ image: postgres:13
+ container_name: postgres
+ ports:
+ - 5432:5432
+ environment:
+ POSTGRES_PASSWORD: public
+ POSTGRES_USER: root
+ POSTGRES_DB: control_station
+ volumes:
+ - $PWD/database/create-table.sql:/docker-entrypoint-initdb.d/init.sql
+
+
+ pgadmin:
+ image: dpage/pgadmin4
+ container_name: pgadmin
+ environment:
+ - PGADMIN_DEFAULT_EMAIL=admin@admin.com
+ - PGADMIN_DEFAULT_PASSWORD=admin
+ ports:
+ - "5050:80"
+ depends_on:
+ - postgres
networks:
mosquitto:
diff --git a/database/create_table.sql b/database/create_table.sql
new file mode 100644
index 0000000..8ee801a
--- /dev/null
+++ b/database/create_table.sql
@@ -0,0 +1,6 @@
+create table if not exists climameasures (
+ stationname varchar(255),
+ measurevalue int null,
+ unit float null,
+ currenttime timestamp default current_timestamp
+); \ No newline at end of file
diff --git a/mosquitto-config/mosquitto.conf b/mosquitto-config/mosquitto.conf
index f913973..7e941f9 100644
--- a/mosquitto-config/mosquitto.conf
+++ b/mosquitto-config/mosquitto.conf
@@ -1,3 +1,3 @@
listener 1883 0.0.0.0
-allow_anonymous false
-password_file /mosquitto/config/pass-file
+allow_anonymous true
+# password_file /mosquitto/config/pass-file