diff --git a/.env.example b/.env.example index 372fc79..afb8baf 100644 --- a/.env.example +++ b/.env.example @@ -1,18 +1,18 @@ POSTGRES_DIALECT_DRIVER=postgresql+psycopg POSTGRES_USER=admin POSTGRES_PASSWORD=admin -POSTGRES_HOST=postgres +POSTGRES_HOST=localhost POSTGRES_DB=desbordante POSTGRES_PORT=5432 RABBITMQ_DEFAULT_USER=guest RABBITMQ_DEFAULT_PASSWORD=guest -RABBITMQ_HOST=rabbitmq +RABBITMQ_HOST=localhost RABBITMQ_PORT=5672 RABBITMQ_HTTP_PORT=15672 BACKEND_PORT=8000 -UPLOADED_FILES_DIR_PATH=/volumes/uploads +UPLOADED_FILES_DIR_PATH=./volumes/uploads FLOWER_USER=admin FLOWER_PASSWORD=admin diff --git a/Makefile b/Makefile index b5e02b2..d7a2941 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: env volumes install-deps up open-db pg-revision pg-migrate pg-downgrade celery-worker app init lint test check-types +.PHONY: env install-deps up open-db pg-revision pg-migrate pg-downgrade celery-worker app init lint test check-types ifeq ($(shell test -e '.env' && echo -n yes), yes) include .env @@ -12,13 +12,6 @@ env: @echo >> .env @echo "SECRET_KEY=$$(openssl rand -hex 32)" >> .env -## Create folders for volumes -volumes: - @for volume in postgres rabbitmq uploads; do \ - mkdir -p ./volumes/$$volume; \ - chmod 777 ./volumes/$$volume; \ - done - ## Install dependencies install-deps: poetry install @@ -51,11 +44,12 @@ celery-worker: ## Run application server in watch mode app: + -make pg-migrate head poetry run uvicorn --port 8000 internal:app --reload ## Initiate repository init: - make env volumes install-deps + make env install-deps ## Run all formatters and linters in project lint: diff --git a/dev-docker-compose.yaml b/dev-docker-compose.yaml index 817bd57..8f0a09a 100644 --- a/dev-docker-compose.yaml +++ b/dev-docker-compose.yaml @@ -1,6 +1,4 @@ # Development only -version: '3.8' - services: postgres: container_name: desbordante-postgres @@ -37,17 +35,21 @@ services: # ports: # - "${BACKEND_PORT}:8000" - celery: - build: - context: . - command: /celery - volumes: - - ./volumes/uploads:${UPLOADED_FILES_DIR_PATH} - env_file: - - .env - depends_on: - - rabbitmq - restart: always +# celery: +# build: +# context: . +# command: /celery +# volumes: +# - ./volumes/uploads:/volumes/uploads +# env_file: +# - .env +# environment: +# - RABBITMQ_HOST=rabbitmq +# - POSTGRES_HOST=postgres +# - UPLOADED_FILES_DIR_PATH=/volumes/uploads +# depends_on: +# - rabbitmq +# restart: always flower: @@ -55,12 +57,16 @@ services: context: . command: /flower volumes: - - ./volumes/uploads:${UPLOADED_FILES_DIR_PATH} + - ./volumes/uploads:/volumes/uploads env_file: - .env + environment: + - RABBITMQ_HOST=rabbitmq + - POSTGRES_HOST=postgres + - UPLOADED_FILES_DIR_PATH=/volumes/uploads depends_on: - rabbitmq - - celery +# - celery restart: always ports: - "${FLOWER_PORT}:5555"