Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
__pycache__/
*.pyc
*.pyo
*.pyd
.git
.github
*.egg-info
dist/
build/
.env
.venv
venv/
*.ipynb
.tox/
30 changes: 30 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker Build and Test

on:
push:
branches:
- main
paths-ignore:
- README.md
pull_request:
branches:
- main
paths-ignore:
- README.md
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build Docker image
run: docker build -t harmony-test .

- name: Run tests inside Docker container
run: |
docker run \
-e HARMONY_LITE=no_transformers \
-e PYTHONPATH=/app/src \
harmony-test
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM python:3.10-slim

# Install Java (required by Tika for PDF parsing)
RUN apt-get update && apt-get install -y \
default-jdk \
&& rm -rf /var/lib/apt/lists/*

# Set Java environment
ENV JAVA_HOME=/usr/lib/jvm/default-java
ENV PATH="${JAVA_HOME}/bin:${PATH}"

WORKDIR /app

# Copy and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Install dev dependencies
RUN pip install --no-cache-dir pytest tox

# Copy source code
COPY . .

# Set Python path so src/ is found
ENV PYTHONPATH=/app/src

CMD ["python", "-m", "pytest", "tests/", "-v"]
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'

services:
harmony:
build: .
volumes:
- .:/app
- harmony_models:/root/harmony
environment:
- PYTHONPATH=/app/src
- HARMONY_LITE=no_transformers
command: python -m pytest tests/ -v

volumes:
harmony_models: