diff --git a/develop/docker-compose.yml b/develop/docker-compose.yml new file mode 100644 index 00000000..4abaed5f --- /dev/null +++ b/develop/docker-compose.yml @@ -0,0 +1,60 @@ +version: "3" + +services: + db: + image: postgres:16 + ports: + - "5432:5432" + environment: + POSTGRES_USER: "postgres" + POSTGRES_PASSWORD: "password" + POSTGRES_DB: "hideout" + + mongodb: + image: mongo:7.0.14 + ports: + - "27017:27017" + + elasticsearch: + image: docker.elastic.co/elasticsearch/elasticsearch:7.17.24 + container_name: elasticsearch + environment: + - discovery.type=single-node + - cluster.name=docker-cluster + - bootstrap.memory_lock=true + - xpack.security.enabled=true + - xpack.monitoring.collection.enabled=true + - ELASTIC_PASSWORD=Passw0rd + - "ES_JAVA_OPTS=-Xms512M -Xmx512M" + ports: + - "9200:9200" + volumes: + - elasticsearch-data:/usr/share/elasticsearch/data + restart: always + kibana: + image: docker.elastic.co/kibana/kibana:7.17.24 + container_name: kibana + ports: + - "5601:5601" + environment: + - ELASTICSEARCH_URL=http://elasticsearch:9200 + - ELASTICSEARCH_USERNAME=elastic + - ELASTICSEARCH_PASSWORD=Passw0rd + depends_on: + - elasticsearch + restart: always + + fluentd: + build: ./fluentd + volumes: + - ./fluentd/conf:/fluentd/etc + - ../logs:/in + depends_on: + - "elasticsearch" + ports: + - "24224:24224" + - "24224:24224/udp" + +volumes: + elasticsearch-data: + driver: local \ No newline at end of file diff --git a/develop/fluentd/Dockerfile b/develop/fluentd/Dockerfile new file mode 100644 index 00000000..1070a2ce --- /dev/null +++ b/develop/fluentd/Dockerfile @@ -0,0 +1,4 @@ +FROM fluent/fluentd:v1.16-debian-2 +USER root +RUN fluent-gem install fluent-plugin-elasticsearch --no-document +USER fluent \ No newline at end of file diff --git a/develop/fluentd/conf/fluent.conf b/develop/fluentd/conf/fluent.conf new file mode 100644 index 00000000..51dbd4cf --- /dev/null +++ b/develop/fluentd/conf/fluent.conf @@ -0,0 +1,19 @@ + + @type tail + path /in/logFile.log.json + pos_file /in/logFile.pos + tag hideout + + @type json + + + + + @type elasticsearch + host elasticsearch + port 9200 + index_name logs + include_timestamp true + user elastic + password Passw0rd + \ No newline at end of file diff --git a/http-client.env.json b/develop/http-client.env.json similarity index 100% rename from http-client.env.json rename to develop/http-client.env.json diff --git a/mastodon-api.http b/develop/mastodon-api.http similarity index 100% rename from mastodon-api.http rename to develop/mastodon-api.http diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 274d183c..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: "3" - -services: - db: - image: postgres:16 - ports: - - "5432:5432" - environment: - POSTGRES_USER: "postgres" - POSTGRES_PASSWORD: "password" - POSTGRES_DB: "hideout" - - mongodb: - image: mongo:7.0.14 - ports: - - "27017:27017" \ No newline at end of file diff --git a/hideout-core/src/main/resources/logback-spring.xml b/hideout-core/src/main/resources/logback-spring.xml index 62421f27..a29f493e 100644 --- a/hideout-core/src/main/resources/logback-spring.xml +++ b/hideout-core/src/main/resources/logback-spring.xml @@ -1,7 +1,7 @@ - + @@ -12,4 +12,8 @@ + + + + \ No newline at end of file