File tree Expand file tree Collapse file tree 11 files changed +50
-66
lines changed Expand file tree Collapse file tree 11 files changed +50
-66
lines changed Original file line number Diff line number Diff line change 1+ MODE = PRODUCTION
2+
3+ # GATEWAY
4+ GATEWAY_PORT = 5000
5+
6+ # #### SERVICES #####
7+ # Tasks app
8+ TASKS_APP_PORT = 5001
9+ TASKS_MICROSERVICE_URL = http://tasks_app:5001
10+ # Database
11+ TASKS_DB_USER = postgres
12+ TASKS_DB_PASS = postgres
13+ TASKS_DB_HOST = db_tasks_app
14+ TASKS_DB_PORT = 5432
15+ TASKS_DB_NAME = tasks_app
16+ # #### SERVICES #####
17+
18+ # Grafana
19+ GRAFANA_PORT = 3010
20+ # Loki
21+ LOKI_PORT = 3100
Original file line number Diff line number Diff line change 11MODE = TEST
22
3- # Gateway
3+ # GATEWAY
44GATEWAY_PORT = 5000
55
6+ # #### SERVICES #####
67# Tasks app
78TASKS_APP_PORT = 5001
8-
9+ TASKS_MICROSERVICE_URL = http://tasks_app_test:5001
10+ # Database
911TASKS_DB_USER = postgres
1012TASKS_DB_PASS = postgres
1113TASKS_DB_HOST = db_tasks_app_test
1214TASKS_DB_PORT = 5432
1315TASKS_DB_NAME = tasks_app_test
16+ # #### SERVICES #####
1417
1518# Kafka
1619KAFKA_BOOTSTRAP = kafka_test:9092
1720KAFKA_TOPIC = task_events_test
1821KAFKA_CLIENT_ID = tasks_app_test
1922
23+ # Grafana
24+ GRAFANA_PORT = 3010
2025# Loki
21- LOKI_PORT = 3100
22-
23- # Порт для Grafana
24- GRAFANA_PORT = 3010
26+ LOKI_PORT = 3100
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ jobs:
1515 uses : actions/checkout@v4
1616
1717 - name : Build and start test services
18- run : docker compose -f docker-compose.test.yml --env-file ./tasks/ .env.test up -d --build
18+ run : docker compose -f docker-compose.test.yml --env-file= .env.test up -d --build
1919
2020 - name : Run tests
21- run : docker compose -f docker-compose.test.yml --env-file ./tasks/. env.test exec -T tasks_app_test pytest -v
21+ run : docker compose -f docker-compose.test.yml --env-file=. env.test exec -T tasks_app_test pytest
2222
2323 - name : Stop and remove test services
2424 if : always()
25- run : docker compose -f docker-compose.test.yml --env-file ./tasks/ .env.test down -v --remove-orphans
25+ run : docker compose -f docker-compose.test.yml --env-file= .env.test down -v --remove-orphans
Original file line number Diff line number Diff line change 11up :
2- docker compose up
2+ docker compose --env-file=.env.example up -d
33
44down :
5- docker compose down
5+ docker compose --env-file=.env.example down
66
77build :
8- docker compose up --build -d
8+ docker compose --env-file=.env.example up --build -d
99
1010test :
11- docker compose -f docker-compose.test.yml up --build -d
12- docker compose -f docker-compose.test.yml exec -it tasks_app_test bash -c " pytest -v"
13- docker compose -f docker-compose.test.yml down -v --remove-orphans
11+ docker compose -f docker-compose.test.yml --env-file=.env.test up --build -d
12+ docker compose -f docker-compose.test.yml --env-file=.env.test exec -it tasks_app_test bash -c " pytest -v"
13+ docker compose -f docker-compose.test.yml --env-file=.env.test down -v --remove-orphans
Original file line number Diff line number Diff line change 41412 . Запустите приложение с помощью Makefile:
4242
4343``` bash
44- make build
44+ make build # Сборка/пересборка проекта
45+ make down # Остановка проекта
46+ make up # Запуск проекта
4547```
4648
4749## 🧪 Запуск тестов
@@ -66,7 +68,7 @@ make test
6668
6769Создайте файл ` .env ` в корне сервиса
6870` gateway/ ` , ` tasks/ ` .
69- Аналогично файлу ` .env.test ` .
71+ Аналогично файлу ` .env.example ` .
7072
7173``` env
7274MODE = DEVELOPMENT
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ services:
44 context : tasks/
55 container_name : tasks_app_test
66 env_file :
7- - ./tasks/. env.test
7+ - .env.test
88 ports :
99 - " ${TASKS_APP_PORT}"
1010 entrypoint : ["sh", "-c"]
@@ -26,7 +26,7 @@ services:
2626 context : tasks/
2727 container_name : tasks_app_worker_test
2828 env_file :
29- - ./tasks/. env.test
29+ - .env.test
3030 environment :
3131 SERVICE_NAME : tasks_app_test
3232 KAFKA_BOOTSTRAP : kafka_test:9092
@@ -44,7 +44,7 @@ services:
4444 image : postgres:17
4545 container_name : db_tasks_app_test
4646 env_file :
47- - ./tasks/. env.test
47+ - .env.test
4848 environment :
4949 POSTGRES_USER : ${TASKS_DB_USER}
5050 POSTGRES_PASSWORD : ${TASKS_DB_PASS}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ services:
44 context : gateway/
55 container_name : gateway_app
66 env_file :
7- - ./gateway/. env.docker
7+ - .env.example
88 ports :
99 - " ${GATEWAY_PORT}:${GATEWAY_PORT}"
1010 networks :
@@ -26,7 +26,7 @@ services:
2626 context : gateway/
2727 container_name : locust_gateway
2828 env_file :
29- - ./gateway/. env.docker
29+ - .env.example
3030 ports :
3131 - " 8089:8089"
3232 networks :
@@ -45,7 +45,7 @@ services:
4545 context : tasks/
4646 container_name : tasks_app
4747 env_file :
48- - ./tasks/. env.docker
48+ - .env.example
4949 ports :
5050 - " ${TASKS_APP_PORT}"
5151 entrypoint : ["sh", "-c"]
@@ -71,7 +71,7 @@ services:
7171 context : tasks/
7272 container_name : tasks_app_worker
7373 env_file :
74- - ./tasks/. env.docker
74+ - .env.example
7575 environment :
7676 SERVICE_NAME : tasks_app
7777 KAFKA_BOOTSTRAP : kafka:9092
@@ -95,7 +95,7 @@ services:
9595 image : postgres:17
9696 container_name : db_tasks_app
9797 env_file :
98- - ./tasks/. env.docker
98+ - .env.example
9999 environment :
100100 POSTGRES_USER : ${TASKS_DB_USER}
101101 POSTGRES_PASSWORD : ${TASKS_DB_PASS}
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments