From 0956c19c57d1af2e530211afde1ea3423c9a4e74 Mon Sep 17 00:00:00 2001 From: N0str Date: Fri, 21 Jan 2022 14:52:57 +0300 Subject: [PATCH] Remove fixed container name. Add rabbitmq volume --- core.prod.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ core.yml | 6 ++++-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 core.prod.yml diff --git a/core.prod.yml b/core.prod.yml new file mode 100644 index 0000000..fae5757 --- /dev/null +++ b/core.prod.yml @@ -0,0 +1,45 @@ +version: "3.4" +services: + mongodb: + image: mongo:4.4 + volumes: + - botcoremongodata:/data/db + ports: + - "127.0.0.1:27017:27017" + healthcheck: + test: echo 'db.runCommand("ping").ok' | mongo 127.0.0.1:27017/test --quiet + interval: 10s + timeout: 10s + retries: 5 + start_period: 10s + + rabbitmq: + image: rabbitmq:3-management-alpine + volumes: + - botcorerabbitdata:/data/db + ports: + - "127.0.0.1:5672:5672" + - "127.0.0.1:15672:15672" + healthcheck: + test: [ "CMD", "nc", "-z", "127.0.0.1", "5672" ] + interval: 10s + timeout: 10s + retries: 5 + + codex-bot-core: + image: codexteamuser/codex-bot-core:stage + command: python main.py + restart: on-failure + env_file: + - .env + depends_on: + mongodb: + condition: service_healthy + rabbitmq: + condition: service_healthy + ports: + - "127.0.0.1:1337:1337" + +volumes: + botcoremongodata: + botcorerabbitdata: \ No newline at end of file diff --git a/core.yml b/core.yml index ed03e73..dc1c2ac 100644 --- a/core.yml +++ b/core.yml @@ -15,7 +15,8 @@ services: rabbitmq: image: rabbitmq:3-management-alpine - container_name: rabbitmq + volumes: + - botcorerabbitdata:/data/db ports: - "127.0.0.1:5672:5672" - "127.0.0.1:15672:15672" @@ -42,4 +43,5 @@ services: - "127.0.0.1:1337:1337" volumes: - botcoremongodata: \ No newline at end of file + botcoremongodata: + botcorerabbitdata: \ No newline at end of file