- Introduced EventWithSettings and EventWithSettingsRes structs for enhanced event data handling. - Implemented conversion functions for creating and updating event settings. - Added support for fetching events with settings from the database. - Created new report data structures for comprehensive reporting capabilities. - Implemented event statistics retrieval and filtering by league and sport. - Added handlers for event statistics endpoints in the web server. - Introduced DateInterval type for managing time intervals in reports.
106 lines
2.2 KiB
YAML
106 lines
2.2 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
postgres:
|
|
container_name: fortunebet-backend-postgres-1
|
|
image: postgres:16-alpine
|
|
ports:
|
|
- 5422:5432
|
|
environment:
|
|
- POSTGRES_PASSWORD=secret
|
|
- POSTGRES_USER=root
|
|
- POSTGRES_DB=gh
|
|
networks:
|
|
- app
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U root -d gh"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./exports:/exports
|
|
mongo:
|
|
container_name: fortunebet-mongo
|
|
image: mongo:7.0.11
|
|
restart: always
|
|
ports:
|
|
- "27017:27017"
|
|
environment:
|
|
MONGO_INITDB_ROOT_USERNAME: root
|
|
MONGO_INITDB_ROOT_PASSWORD: secret
|
|
volumes:
|
|
- mongo_data:/data/db
|
|
networks:
|
|
- app
|
|
healthcheck:
|
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
migrate:
|
|
image: migrate/migrate
|
|
volumes:
|
|
- ./db/migrations:/migrations
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
command:
|
|
[
|
|
"-path",
|
|
"/migrations",
|
|
"-database",
|
|
"postgresql://root:secret@postgres:5432/gh?sslmode=disable",
|
|
"up",
|
|
]
|
|
networks:
|
|
- app
|
|
# redis:
|
|
# image: redis:7-alpine
|
|
# ports:
|
|
# - "6379:6379"
|
|
# networks:
|
|
# - app
|
|
# healthcheck:
|
|
# test: ["CMD", "redis-cli", "ping"]
|
|
# interval: 10s
|
|
# timeout: 5s
|
|
# retries: 5
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: runner
|
|
ports:
|
|
- ${PORT}:8080
|
|
environment:
|
|
- DB_URL=postgresql://root:secret@postgres:5432/gh?sslmode=disable
|
|
- MONGO_URI=mongodb://root:secret@mongo:27017
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- app
|
|
command: ["/app/bin/web"]
|
|
# volumes:
|
|
# - "C:/Users/User/Desktop:/host-desktop"
|
|
|
|
test:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: builder
|
|
volumes:
|
|
- .:/app
|
|
command: ["tail", "-f", "/dev/null"]
|
|
networks:
|
|
- app
|
|
|
|
networks:
|
|
app:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
postgres_data:
|
|
mongo_data:
|