An ASP.NET Core Web API for querying TTT2 (Trouble in Terrorist Town 2) statistics from a Garry's Mod SQLite database.
This application is Docker-ready with multi-stage builds for efficient containerization.
docker build -t ttt2stats-api .You need to specify the path to your sv.db file using the --sv-path argument:
docker run -d \
-p 8080:8080 \
-v /path/to/your/sv.db:/data/sv.db:ro \
ttt2stats-api \
--sv-path /data/sv.db-
Edit
docker-compose.ymland update the volume path to point to yoursv.dbfile:volumes: - /path/to/your/sv.db:/data/sv.db:ro
-
Start the service:
docker-compose up -d
-
View logs:
docker-compose logs -f
-
Stop the service:
docker-compose down
ASPNETCORE_ENVIRONMENT: Set toDevelopmentorProduction(default:Production)ASPNETCORE_URLS: HTTP endpoint URLs (default:http://+:8080)
The application accepts the following command-line argument:
--sv-path: Path to the Garry's Modsv.dbSQLite database file (required)
You can also set SV_Path in appsettings.json or through environment variables:
docker run -d \
-p 8080:8080 \
-e SV_Path=/data/sv.db \
-v /path/to/your/sv.db:/data/sv.db:ro \
ttt2stats-apiOnce running, access the Swagger UI at:
- Development:
http://localhost:8080/swagger