From 17f4946b7a23777b8aab823c17e6139633d9ab38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=9F=D0=BE=D0=B7?= =?UTF-8?q?=D0=B4=D0=BD=D1=8F=D0=BA=D0=BE=D0=B2?= Date: Sun, 11 Sep 2022 23:29:44 +0300 Subject: [PATCH] Fix docker compose --- apps/explorer/lib/explorer/application.ex | 4 +--- config/runtime/dev.exs | 11 ----------- config/runtime/prod.exs | 11 ----------- config/runtime/test.exs | 11 ----------- docker-compose/docker-compose-no-build-ganache.yml | 5 +++++ docker-compose/docker-compose-no-build-geth.yml | 5 +++++ .../docker-compose-no-build-hardhat-network.yml | 5 +++++ ...cker-compose-no-build-open-ethereum-nethermind.yml | 5 +++++ .../docker-compose-no-rust-verification.yml | 5 +++++ docker-compose/docker-compose.yml | 7 +++---- docker-compose/envs/common-blockscout.env | 4 ++-- 11 files changed, 31 insertions(+), 42 deletions(-) diff --git a/apps/explorer/lib/explorer/application.ex b/apps/explorer/lib/explorer/application.ex index 2a646b0728..1fd3a6cd2e 100644 --- a/apps/explorer/lib/explorer/application.ex +++ b/apps/explorer/lib/explorer/application.ex @@ -179,8 +179,6 @@ defmodule Explorer.Application do end defp redix_opts do - config = Application.get_env(:explorer, Redix) - - [name: :redix, host: config[:host], port: config[:port]] + {System.get_env("ACCOUNT_REDIS_URL") || "redis://127.0.0.1:6379", [name: :redix]} end end diff --git a/config/runtime/dev.exs b/config/runtime/dev.exs index 491113adb1..a4d0d5b6a7 100644 --- a/config/runtime/dev.exs +++ b/config/runtime/dev.exs @@ -103,17 +103,6 @@ variant = Code.require_file("#{variant}.exs", "apps/explorer/config/dev") -redis_port = - case System.get_env("ACCOUNT_REDIS_PORT") && Integer.parse(System.get_env("ACCOUNT_REDIS_PORT")) do - {port, _} -> port - :error -> nil - nil -> nil - end - -config :explorer, Redix, - host: System.get_env("ACCOUNT_REDIS_HOST_URL") || "127.0.0.1", - port: redis_port || 6379 - ############### ### Indexer ### ############### diff --git a/config/runtime/prod.exs b/config/runtime/prod.exs index 0218804f4f..2b15151aab 100644 --- a/config/runtime/prod.exs +++ b/config/runtime/prod.exs @@ -70,17 +70,6 @@ variant = Code.require_file("#{variant}.exs", "apps/explorer/config/prod") -redis_port = - case System.get_env("ACCOUNT_REDIS_PORT") && Integer.parse(System.get_env("ACCOUNT_REDIS_PORT")) do - {port, _} -> port - :error -> nil - nil -> nil - end - -config :explorer, Redix, - host: System.get_env("ACCOUNT_REDIS_HOST_URL"), - port: redis_port - ############### ### Indexer ### ############### diff --git a/config/runtime/test.exs b/config/runtime/test.exs index 9260627d25..38cd15e0df 100644 --- a/config/runtime/test.exs +++ b/config/runtime/test.exs @@ -24,17 +24,6 @@ variant = Code.require_file("#{variant}.exs", "apps/explorer/config/test") -redis_port = - case System.get_env("ACCOUNT_REDIS_PORT") && Integer.parse(System.get_env("ACCOUNT_REDIS_PORT")) do - {port, _} -> port - :error -> nil - nil -> nil - end - -config :explorer, Redix, - host: System.get_env("ACCOUNT_REDIS_HOST_URL") || "127.0.0.1", - port: redis_port || 6379 - ############### ### Indexer ### ############### diff --git a/docker-compose/docker-compose-no-build-ganache.yml b/docker-compose/docker-compose-no-build-ganache.yml index 619e8104b0..62a007a2b0 100644 --- a/docker-compose/docker-compose-no-build-ganache.yml +++ b/docker-compose/docker-compose-no-build-ganache.yml @@ -1,6 +1,10 @@ version: '3.8' services: + redis_db: + image: 'redis:alpine' + command: redis-server + db: image: postgres:14 restart: always @@ -16,6 +20,7 @@ services: depends_on: - db - smart-contract-verifier + - redis_db image: blockscout/blockscout:${DOCKER_TAG:-latest} restart: always container_name: 'blockscout' diff --git a/docker-compose/docker-compose-no-build-geth.yml b/docker-compose/docker-compose-no-build-geth.yml index ec6e64d248..d4f59f9a4d 100644 --- a/docker-compose/docker-compose-no-build-geth.yml +++ b/docker-compose/docker-compose-no-build-geth.yml @@ -1,6 +1,10 @@ version: '3.8' services: + redis_db: + image: 'redis:alpine' + command: redis-server + db: image: postgres:14 restart: always @@ -18,6 +22,7 @@ services: depends_on: - db - smart-contract-verifier + - redis_db image: blockscout/blockscout:${DOCKER_TAG:-latest} restart: always container_name: 'blockscout' diff --git a/docker-compose/docker-compose-no-build-hardhat-network.yml b/docker-compose/docker-compose-no-build-hardhat-network.yml index 9a74d44f10..aaab30fd1e 100644 --- a/docker-compose/docker-compose-no-build-hardhat-network.yml +++ b/docker-compose/docker-compose-no-build-hardhat-network.yml @@ -1,6 +1,10 @@ version: '3.8' services: + redis_db: + image: 'redis:alpine' + command: redis-server + db: image: postgres:14 restart: always @@ -16,6 +20,7 @@ services: depends_on: - db - smart-contract-verifier + - redis_db image: blockscout/blockscout:${DOCKER_TAG:-latest} restart: always container_name: 'blockscout' diff --git a/docker-compose/docker-compose-no-build-open-ethereum-nethermind.yml b/docker-compose/docker-compose-no-build-open-ethereum-nethermind.yml index 9a272acb57..cde891f1ad 100644 --- a/docker-compose/docker-compose-no-build-open-ethereum-nethermind.yml +++ b/docker-compose/docker-compose-no-build-open-ethereum-nethermind.yml @@ -1,6 +1,10 @@ version: '3.8' services: + redis_db: + image: 'redis:alpine' + command: redis-server + db: image: postgres:14 restart: always @@ -18,6 +22,7 @@ services: depends_on: - db - smart-contract-verifier + - redis_db image: blockscout/blockscout:${DOCKER_TAG:-latest} restart: always container_name: 'blockscout' diff --git a/docker-compose/docker-compose-no-rust-verification.yml b/docker-compose/docker-compose-no-rust-verification.yml index 74c3b77642..2f809bcfe2 100644 --- a/docker-compose/docker-compose-no-rust-verification.yml +++ b/docker-compose/docker-compose-no-rust-verification.yml @@ -1,6 +1,10 @@ version: '3.8' services: + redis_db: + image: 'redis:alpine' + command: redis-server + db: image: postgres:14 restart: always @@ -15,6 +19,7 @@ services: blockscout: depends_on: - db + - redis_db image: blockscout/blockscout:${DOCKER_TAG:-latest} build: context: .. diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index b971fcb22b..e9043545f3 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -1,11 +1,9 @@ version: '3.8' services: - redis: - image: "redis:alpine" + redis_db: + image: 'redis:alpine' command: redis-server - ports: - - 6379:6379 db: image: postgres:14 @@ -22,6 +20,7 @@ services: depends_on: - db - smart-contract-verifier + - redis_db image: blockscout/blockscout:${DOCKER_TAG:-latest} build: context: .. diff --git a/docker-compose/envs/common-blockscout.env b/docker-compose/envs/common-blockscout.env index 171d39e9e5..419103c577 100644 --- a/docker-compose/envs/common-blockscout.env +++ b/docker-compose/envs/common-blockscout.env @@ -138,5 +138,5 @@ RUST_VERIFICATION_SERVICE_URL=http://host.docker.internal:8043/ # ACCOUNT_SENDGRID_SENDER= # ACCOUNT_SENDGRID_TEMPLATE= ACCOUNT_CLOAK_KEY= -ACCOUNT_REDIS_HOST_URL=http://host.docker.internal -ACCOUNT_REDIS_PORT=6379 \ No newline at end of file +ACCOUNT_ENABLED=false +ACCOUNT_REDIS_URL=redis://redis_db:6379 \ No newline at end of file