-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from Bot-detector/api_v3
Api v3
- Loading branch information
Showing
15 changed files
with
1,102 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
token = verify_ban | ||
api = http://localhost:5000 | ||
secret_token = super_secret_token | ||
detector_api = http://localhost:5000 | ||
secret_token = super_secret_token | ||
private_api = http://localhost:5001/v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
docker-restart: | ||
docker compose down | ||
docker compose up --build -d | ||
|
||
docker-test: | ||
docker compose down | ||
docker compose up --build -d | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,99 @@ | ||
version: '3' | ||
services: | ||
mysql: | ||
container_name: database | ||
build: | ||
context: ../bot-detector-mysql | ||
dockerfile: Dockerfile | ||
image: bot-detector/bd-mysql:latest | ||
context: ./mysql | ||
image: bot-detector/mysql:latest | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=root_bot_buster | ||
- MYSQL_USER=botssuck | ||
- MYSQL_PASSWORD=botdetector | ||
volumes: | ||
- '../bot-detector-mysql/mount:/var/lib/mysql' | ||
- '../bot-detector-mysql/docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d/' | ||
- ./mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d | ||
# - ./mysql/mount:/var/lib/mysql # creates persistence | ||
ports: | ||
- "3306:3306" | ||
- 3307:3306 | ||
networks: | ||
- botdetector-network | ||
healthcheck: | ||
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] | ||
timeout: 20s | ||
retries: 10 | ||
|
||
api: | ||
mysql_setup: | ||
container_name: mysql_setup | ||
image: bot-detector/mysql_setup | ||
build: | ||
context: ../Bot-Detector-Core-Files | ||
dockerfile: Dockerfile | ||
args: | ||
root_path: '' | ||
api_port: 5000 | ||
image: bot-detector/bd-api:latest | ||
context: ./mysql_setup | ||
command: ["python", "-u","setup_mysql.py"] | ||
networks: | ||
- botdetector-network | ||
depends_on: | ||
mysql: | ||
condition: service_healthy | ||
|
||
core_api: | ||
image: quay.io/bot_detector/bd-core-files:4f82016 | ||
command: uvicorn src.core.server:app --host 0.0.0.0 --reload --reload-include src/* | ||
environment: | ||
- sql_uri=mysql+asyncmy://root:root_bot_buster@mysql:3306/playerdata | ||
- discord_sql_uri=mysql+asyncmy://root:root_bot_buster@mysql:3306/discord | ||
- token=verify_ban | ||
volumes: | ||
- '../Bot-Detector-Core-Files/api:/code/api' | ||
- env=DEV | ||
# Ports exposed to the other services but not to the host machine | ||
expose: | ||
- 5000 | ||
ports: | ||
- 5001:5000 | ||
networks: | ||
- botdetector-network | ||
depends_on: | ||
mysql_setup: | ||
condition: service_completed_successfully | ||
|
||
private_api: | ||
image: quay.io/bot_detector/private-api:e96c31a | ||
command: uvicorn src.core.server:app --host 0.0.0.0 --reload --reload-include src/* | ||
# Ports exposed to the other services but not to the host machine | ||
expose: | ||
- 5000 | ||
ports: | ||
- "5000:5000" | ||
- 5002:5000 | ||
networks: | ||
- botdetector-network | ||
# this overrides the env_file for the specific variable | ||
environment: | ||
- KAFKA_HOST=kafka:9092 | ||
- DATABASE_URL=mysql+aiomysql://root:root_bot_buster@mysql:3306/playerdata | ||
- ENV=DEV | ||
- POOL_RECYCLE=60 | ||
- POOL_TIMEOUT=30 | ||
depends_on: | ||
- mysql | ||
machine-learning: | ||
mysql_setup: | ||
condition: service_completed_successfully | ||
|
||
machine_learning: | ||
container_name: bd-ml | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
target: base | ||
args: | ||
root_path: '/' | ||
root_path: / | ||
api_port: 8000 | ||
container_name: bd-ml | ||
command: uvicorn api.app:app --host 0.0.0.0 --reload --reload-include api/* | ||
env_file: | ||
- .env | ||
environment: | ||
- token=verify_ban | ||
- secret_token=super_secret_token | ||
- private_api=http://private_api:5000 | ||
- detector_api=http://core_api:5000 | ||
volumes: | ||
- ../bot-detector-ML/api:/project/api | ||
- ./api:/project/api | ||
ports: | ||
- 8000:8000 | ||
- 5003:8000 | ||
networks: | ||
- botdetector-network | ||
depends_on: | ||
- api | ||
- private_api | ||
- core_api | ||
|
||
networks: | ||
botdetector-network: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM mysql:latest | ||
|
||
EXPOSE 3306 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE DATABASE playerdata; |
Oops, something went wrong.