diff --git a/.gitignore b/.gitignore index 5ea2857..39ddd26 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ __pycache__ .mypy_cache /vol +/.env \ No newline at end of file diff --git a/Makefile b/Makefile index ef935b2..a111200 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ .PHONY: start start: - docker-compose up --build -d + docker compose up --build -d .PHONY: stop stop: - docker-compose down -v + docker compose down -v .PHONY: restart restart: - docker-compose restart + docker compose restart .PHONY: clean clean: @@ -19,4 +19,4 @@ reset: stop clean .PHONY: logs logs: - docker-compose logs -f + docker compose logs -f diff --git a/docker-compose.yml b/compose.yml similarity index 81% rename from docker-compose.yml rename to compose.yml index 7c47267..d417525 100644 --- a/docker-compose.yml +++ b/compose.yml @@ -1,5 +1,3 @@ -version: '2.4' - services: farm: build: @@ -8,8 +6,9 @@ services: volumes: - ./server/app:/app environment: - REDIS_URL: 'redis://redis:6379/1' + REDIS_URL: 'redis://redis:6379/0' POSTGRES_DSN: 'host=postgres port=5432 user=farm password=farm dbname=farm' + SERVER_PASSWORD: ${SERVER_PASSWORD} restart: unless-stopped depends_on: postgres: @@ -22,7 +21,7 @@ services: volumes: - ./server/app:/app environment: - CELERY_BROKER_URL: 'redis://redis:6379/0' + CELERY_BROKER_URL: 'redis://redis:6379/1' POSTGRES_DSN: 'host=postgres port=5432 user=farm password=farm dbname=farm' restart: unless-stopped depends_on: @@ -64,17 +63,17 @@ services: - redis redis: - image: redis:7.0.12-alpine + image: redis:7.2.0-alpine restart: unless-stopped - command: [ "redis-server", "--appendonly", "yes" ] + command: ["redis-server", "--appendonly", "yes"] volumes: - ./vol/redis:/data external_redis: - image: redis:7.0.12-alpine + image: redis:7.2.0-alpine ports: - "6378:6379" restart: unless-stopped - command: [ "redis-server", "--appendonly", "yes", "--requirepass", "changeme" ] + command: ["redis-server", "--appendonly", "yes", "--requirepass", "${EXTERNAL_REDIS_PASSWORD:-changeme}"] volumes: - ./vol/external_redis:/data diff --git a/server/app/config.py b/server/app/config.py index d2cf620..918d465 100644 --- a/server/app/config.py +++ b/server/app/config.py @@ -40,7 +40,7 @@ # Password for the web interface. This key will be excluded from config # before sending it to farm clients. # ########## DO NOT FORGET TO CHANGE IT ########## - 'SERVER_PASSWORD': '1234', + 'SERVER_PASSWORD': os.getenv('SERVER_PASSWORD') or '1234', # For all time-related operations 'TIMEZONE': 'Europe/Moscow',