47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
version: '3.7'
|
|
services:
|
|
booksearch_app:
|
|
build: .
|
|
container_name: booksearch_app
|
|
ports:
|
|
- "8000:5000"
|
|
environment:
|
|
- ELASTICSEARCH_HOST=booksearch_elastic
|
|
- BASE_URL=${BASE_URL}
|
|
- CPU_LIMIT=${CPU_LIMIT}
|
|
- SNIPPET_CHAR_LIMIT=${SNIPPET_CHAR_LIMIT}
|
|
volumes:
|
|
- ${SMB_SHARE_PATH}:/books
|
|
depends_on:
|
|
- booksearch_elastic
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: ${CPU_LIMIT}
|
|
memory: 2G
|
|
|
|
booksearch_elastic:
|
|
container_name: booksearch_elastic
|
|
image: bitnami/elasticsearch:latest
|
|
ports:
|
|
- "9200:9200"
|
|
- "9300:9300"
|
|
environment:
|
|
- discovery.type=single-node
|
|
- ELASTICSEARCH_USERNAME=admin
|
|
- ELASTICSEARCH_PASSWORD=password
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9200"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
|
|
booksearch_tests:
|
|
build: .
|
|
container_name: booksearch_tests
|
|
volumes:
|
|
- ./test_data:/app/test_data
|
|
- ./tests:/app/tests
|
|
command: sh -c "cd /app && PYTHONPATH=/app python -m unittest tests.unit.test_epub_extraction -v"
|