From ab4068fd4dfb46a8fa325456da63f606d3a9d9d0 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 13 May 2024 10:29:43 -0400 Subject: [PATCH] SOFD --- docker-compose.production.yml | 8 +- docker-compose.staging.yml | 19 ++-- docker-compose.test.yml | 18 ---- docker/fluentd/Dockerfile | 1 + docker/fluentd/Dockerfile.production | 1 + docker/haste/Dockerfile | 13 --- docker/haste/Dockerfile.production | 1 - docker/opensearch-dashboards/Dockerfile | 1 + .../Dockerfile.production | 1 + docker/opensearch/Dockerfile | 1 + docker/opensearch/Dockerfile.production | 1 + docker/redis/Dockerfile | 1 - docker/redis/Dockerfile.production | 1 - stack.production.yml | 95 +++++++--------- stack.staging.yml | 102 +++++++----------- 15 files changed, 105 insertions(+), 159 deletions(-) delete mode 100644 docker-compose.test.yml create mode 100644 docker/fluentd/Dockerfile create mode 100644 docker/fluentd/Dockerfile.production delete mode 100644 docker/haste/Dockerfile delete mode 100644 docker/haste/Dockerfile.production create mode 100644 docker/opensearch-dashboards/Dockerfile create mode 100644 docker/opensearch-dashboards/Dockerfile.production create mode 100644 docker/opensearch/Dockerfile create mode 100644 docker/opensearch/Dockerfile.production delete mode 100644 docker/redis/Dockerfile delete mode 100644 docker/redis/Dockerfile.production diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 7ac2cff..d821bf3 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -4,9 +4,9 @@ services: build: context: docker/redis dockerfile: Dockerfile.production - image: git.nixc.us/colin/haste:production-redis - haste: + image: git.nixc.us/nixius/sofd:production-redis + opensearch: build: - context: docker/haste + context: docker/opensearch dockerfile: Dockerfile.production - image: git.nixc.us/colin/haste:production-haste \ No newline at end of file + image: git.nixc.us/nixius/sofd:production-opensearch \ No newline at end of file diff --git a/docker-compose.staging.yml b/docker-compose.staging.yml index d7e9f6d..243daa3 100644 --- a/docker-compose.staging.yml +++ b/docker-compose.staging.yml @@ -1,10 +1,17 @@ version: "3.9" services: - redis: + fluentd: build: - context: docker/redis - image: git.nixc.us/colin/haste:staging-redis - haste: + context: docker/fluentd + dockerfile: Dockerfile + image: git.nixc.us/nixius/sofd:staging-fluentd + opensearch: build: - context: docker/haste - image: git.nixc.us/colin/haste:staging-haste \ No newline at end of file + context: docker/opensearch + dockerfile: Dockerfile + image: git.nixc.us/nixius/sofd:staging-opensearch + opensearch-dashboards: + build: + context: docker/opensearch-dashboards + dockerfile: Dockerfile + image: git.nixc.us/nixius/sofd:staging-opensearch-dashboards \ No newline at end of file diff --git a/docker-compose.test.yml b/docker-compose.test.yml deleted file mode 100644 index 20dbd44..0000000 --- a/docker-compose.test.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: '3' -services: - app: - image: git.nixc.us/colin/haste:haste-staging - environment: - TEST_MODE: "true" - STORAGE_TYPE: "redis" - STORAGE_HOST: "redis" - depends_on: - - redis - networks: - - haste-test - redis: - image: redis - networks: - - haste-test -networks: - haste-test: \ No newline at end of file diff --git a/docker/fluentd/Dockerfile b/docker/fluentd/Dockerfile new file mode 100644 index 0000000..401f8f1 --- /dev/null +++ b/docker/fluentd/Dockerfile @@ -0,0 +1 @@ +FROM fluent/fluentd:v1.14.6 \ No newline at end of file diff --git a/docker/fluentd/Dockerfile.production b/docker/fluentd/Dockerfile.production new file mode 100644 index 0000000..a16378f --- /dev/null +++ b/docker/fluentd/Dockerfile.production @@ -0,0 +1 @@ +FROM git.nixc.us/nixius/sofd:staging-fluentd \ No newline at end of file diff --git a/docker/haste/Dockerfile b/docker/haste/Dockerfile deleted file mode 100644 index 397a7f9..0000000 --- a/docker/haste/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:6-alpine as builder -RUN apk add --no-cache git -RUN git clone --depth 1 https://git.nixc.us/Nixius/hastebin.git /app -WORKDIR /app -RUN npm install --production -RUN chmod +x app.sh - -FROM node:6-alpine -WORKDIR /app -COPY --from=builder /app . -RUN npm install --production -RUN npm install mocha -CMD ["/app/app.sh"] diff --git a/docker/haste/Dockerfile.production b/docker/haste/Dockerfile.production deleted file mode 100644 index 1252e37..0000000 --- a/docker/haste/Dockerfile.production +++ /dev/null @@ -1 +0,0 @@ -FROM git.nixc.us/colin/haste:staging-haste \ No newline at end of file diff --git a/docker/opensearch-dashboards/Dockerfile b/docker/opensearch-dashboards/Dockerfile new file mode 100644 index 0000000..f37c7df --- /dev/null +++ b/docker/opensearch-dashboards/Dockerfile @@ -0,0 +1 @@ +FROM opensearchproject/opensearch-dashboards:2.4.0 \ No newline at end of file diff --git a/docker/opensearch-dashboards/Dockerfile.production b/docker/opensearch-dashboards/Dockerfile.production new file mode 100644 index 0000000..7f20303 --- /dev/null +++ b/docker/opensearch-dashboards/Dockerfile.production @@ -0,0 +1 @@ +FROM git.nixc.us/nixius/sofd:staging-opensearch-dashboards \ No newline at end of file diff --git a/docker/opensearch/Dockerfile b/docker/opensearch/Dockerfile new file mode 100644 index 0000000..987e4ee --- /dev/null +++ b/docker/opensearch/Dockerfile @@ -0,0 +1 @@ +FROM opensearchproject/opensearch:2.4.0 \ No newline at end of file diff --git a/docker/opensearch/Dockerfile.production b/docker/opensearch/Dockerfile.production new file mode 100644 index 0000000..233439f --- /dev/null +++ b/docker/opensearch/Dockerfile.production @@ -0,0 +1 @@ +FROM git.nixc.us/nixius/sofd:staging-opensearch \ No newline at end of file diff --git a/docker/redis/Dockerfile b/docker/redis/Dockerfile deleted file mode 100644 index abea3ce..0000000 --- a/docker/redis/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM eqalpha/keydb \ No newline at end of file diff --git a/docker/redis/Dockerfile.production b/docker/redis/Dockerfile.production deleted file mode 100644 index a3e7c0c..0000000 --- a/docker/redis/Dockerfile.production +++ /dev/null @@ -1 +0,0 @@ -FROM git.nixc.us/colin/haste:staging-redis \ No newline at end of file diff --git a/stack.production.yml b/stack.production.yml index ea44947..88e4d57 100644 --- a/stack.production.yml +++ b/stack.production.yml @@ -1,58 +1,45 @@ -version: '3.8' - -services: - redis: - image: git.nixc.us/colin/haste:production-redis - volumes: - - redis_data:/data - networks: - - default - deploy: - placement: - constraints: - - node.hostname == macmini3 - replicas: 1 - restart_policy: - condition: on-failure - - haste: - image: git.nixc.us/colin/haste:production-haste - volumes: - - public_system:/haste/public/system - networks: - - traefik - - default - deploy: - placement: - constraints: - - node.hostname == macmini3 - labels: - homepage.group: apps - homepage.name: HasteBin - homepage.href: https://haste.nixc.us/ - homepage.description: HasteBin - us.nixc.autodeploy: "true" - traefik.enable: "true" - traefik.http.routers.production-haste_haste.rule: "Host(`haste.nixc.us`)" - traefik.http.routers.production-haste_haste.entrypoints: "websecure" - traefik.http.routers.production-haste_haste.tls: "true" - traefik.http.routers.production-haste_haste.tls.certresolver: "letsencryptresolver" - traefik.http.routers.production-haste_haste.service: "production-haste_haste" - traefik.http.services.production-haste_haste.loadbalancer.server.port: "7777" - traefik.docker.network: "traefik" - - replicas: 1 - restart_policy: - condition: on-failure - +version: "3.7" networks: traefik: external: true - default: - driver: overlay + sofd-net: -volumes: - public_system: - driver: local - redis_data: - driver: local +services: + opensearch: + image: git.nixc.us/nixius/sofd:production-opensearch + environment: + cluster.name: "opensearch" + network.host: "0.0.0.0" + node.name: "opensearch" + discovery.type: "single-node" + bootstrap.memory_lock: "false" + ES_JAVA_OPTS: "-Xms1g -Xmx1g" + OPENSEARCH_INITIAL_ADMIN_PASSWORD: "PzGRamsPfmYkv2yBvcuB7xfzdpZhwMCcx" + # volumes: + # - opensearch-data1:/usr/share/elasticsearch/data + networks: + - sofd-net + + fluentd: + image: git.nixc.us/nixius/sofd:production-fluentd + environment: + FLUENTD_CONF: fluent.conf + # volumes: + # - ./fluentd/conf:/fluentd/etc + ports: + - "9880:9880" + networks: + - sofd-net + depends_on: + - opensearch + + opensearch-dashboards: + image: git.nixc.us/nixius/sofd:production-opensearch-dashboards + environment: + OPENSEARCH_HOSTS: "http://opensearch:9200" + OPENSEARCH_USERNAME: "admin" + OPENSEARCH_PASSWORD: "PzGRamsPfmYkv2yBvcuB7xfzdpZhwMCcx" + networks: + - sofd-net + depends_on: + - opensearch \ No newline at end of file diff --git a/stack.staging.yml b/stack.staging.yml index 9d0febd..32661f6 100644 --- a/stack.staging.yml +++ b/stack.staging.yml @@ -1,64 +1,44 @@ -version: '3.8' - -services: - redis: - image: git.nixc.us/colin/haste:staging-redis - # volumes: - # - redis_data:/data - networks: - - default - deploy: - # placement: - # constraints: - # - node.hostname == macmini3 - replicas: 1 - restart_policy: - condition: on-failure - - haste: - image: git.nixc.us/colin/haste:staging-haste - # volumes: - # - public_system:/haste/public/system - networks: - - traefik - - default - environment: - HOST: "0.0.0.0" - PORT: "7777" - KEY_LENGTH: "10" - MAX_LENGTH: "400000" - STATIC_MAX_AGE: "7776000" - RECOMPRESS_STATIC_ASSETS: "true" - LOGGING_LEVEL: "verbose" - LOGGING_TYPE: "Console" - LOGGING_COLORIZE: "false" - KEY_GENERATOR_TYPE: "phonetic" - STORAGE_TYPE: "redis" - STORAGE_PATH: "./data" - STORAGE_HOST: "haste-staging_redis" - STORAGE_PORT: "6379" - STORAGE_DB: "2" - STORAGE_EXPIRE: "2592000" - deploy: - # placement: - # constraints: - # - node.hostname == macmini3 - labels: - us.nixc.autodeploy: "true" - traefik.enable: "true" - traefik.http.routers.staging-haste_haste.rule: "Host(`staging.haste.nixc.us`)" - traefik.http.routers.staging-haste_haste.entrypoints: "websecure" - traefik.http.routers.staging-haste_haste.tls: "true" - traefik.http.routers.staging-haste_haste.tls.certresolver: "letsencryptresolver" - traefik.http.routers.staging-haste_haste.service: "staging-haste_haste" - traefik.http.services.staging-haste_haste.loadbalancer.server.port: "7777" - traefik.docker.network: "traefik" - replicas: 1 - restart_policy: - condition: on-failure - +version: "3.7" networks: traefik: external: true - default: - driver: overlay \ No newline at end of file + sofd-net: +services: + opensearch: + image: git.nixc.us/nixius/sofd:staging-opensearch + environment: + cluster.name: "opensearch" + network.host: "0.0.0.0" + node.name: "opensearch" + discovery.type: "single-node" + bootstrap.memory_lock: "false" + ES_JAVA_OPTS: "-Xms1g -Xmx1g" + OPENSEARCH_INITIAL_ADMIN_PASSWORD: "PzGRamsPfmYkv2yBvcuB7xfzdpZhwMCcx" + # volumes: + # - opensearch-data1:/usr/share/elasticsearch/data + networks: + - sofd-net + + fluentd: + image: git.nixc.us/nixius/sofd:staging-fluentd + environment: + FLUENTD_CONF: fluent.conf + # volumes: + # - ./fluentd/conf:/fluentd/etc + ports: + - "9880:9880" + networks: + - sofd-net + depends_on: + - opensearch + + opensearch-dashboards: + image: git.nixc.us/nixius/sofd:staging-opensearch-dashboards + environment: + OPENSEARCH_HOSTS: "http://opensearch:9200" + OPENSEARCH_USERNAME: "admin" + OPENSEARCH_PASSWORD: "PzGRamsPfmYkv2yBvcuB7xfzdpZhwMCcx" + networks: + - sofd-net + depends_on: + - opensearch \ No newline at end of file