This commit is contained in:
Dmitriy Kazimirov 2025-04-01 09:27:48 +06:00
parent a71805b9da
commit 6a46a20c9e
20 changed files with 16 additions and 6 deletions

View file

@ -9,18 +9,18 @@ RUN pip install flask elasticsearch ebooklib beautifulsoup4 PyPDF2 pytz
RUN mkdir -p /books && chmod 777 /books
# Copy the API code and static files
COPY api/app.py .
COPY api/static /app/static
COPY api/templates /app/templates
COPY src/api/app.py .
COPY src/api/static /app/static
COPY src/api/templates /app/templates
# Expose the API port
EXPOSE 5000
# Copy the indexing script
COPY index.py .
COPY src/core/index.py .
# Copy the test file
COPY api/test_app.py .
COPY tests/unit/test_app.py .
# Add a dummy file to invalidate cache
ADD dummy.txt .

View file

@ -7,7 +7,7 @@ services:
- "8000:5000"
environment:
- ELASTICSEARCH_HOST=booksearch_elastic
- BASE_URL=http://localhost:8000
- BASE_URL=${BASE_URL}
- CPU_LIMIT=${CPU_LIMIT}
- SNIPPET_CHAR_LIMIT=${SNIPPET_CHAR_LIMIT}
volumes:

View file

@ -98,6 +98,16 @@ docker-compose logs -f api
## Maintenance
## restart & rebuild
```bash
docker-compose down && docker-compose up -d --build
```
Logs
```bash
docker logs booksearch_app -f
```
### Log Rotation
Configure Docker log rotation in `/etc/docker/daemon.json`:
```json