Skip to content

chore: created docker file and compose for development envirnment#526

Merged
marcvergees merged 1 commit into
fireform-core:developmentfrom
chetanr25:docker_dev
Jun 6, 2026
Merged

chore: created docker file and compose for development envirnment#526
marcvergees merged 1 commit into
fireform-core:developmentfrom
chetanr25:docker_dev

Conversation

@chetanr25

Copy link
Copy Markdown
Collaborator

docker Dev environment restructure

What changed

The project had a single Dockerfile and docker-compose.yml at the repo root serving both dev and any future prod use. This PR extracts the dev-specific setup into docker/dev/ as the first step of splitting environments cleanly.

Dockerfile (docker/dev/Dockerfile)

The original Dockerfile installed system packages and pip dependencies with no caching. Every docker compose build even when nothing changed re-downloaded apt packages and pip wheels from scratch.

The new Dockerfile uses BuildKit cache mounts:

# Before
RUN apt-get update && apt-get install -y curl libgl1 libglib2.0-0 libxcb1 \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir -r requirements.txt

# After
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
    apt-get update && apt-get install -y curl libgl1 libglib2.0-0 libxcb1

RUN --mount=type=cache,target=/root/.cache/pip \
    pip install -r requirements.txt

Cache mounts keep downloaded apt packages and pip wheels on the host across builds. Rebuilds after a requirements.txt change go from downloading everything again to just installing the delta. Requires Docker 24+ (BuildKit cache mounts stable).

The --no-cache-dir flag is removed since we're intentionally caching keeping it would have defeated the mount.

compose.yml (docker/dev/compose.yml)

Frontend service removed. The frontend has been migrated to its own repo. The old service was python3 -m http.server serving static files from frontend/ that's gone.

All environment values moved to ${VAR} substitution. Previously every value was hardcoded directly in the compose file:

# Before
- OLLAMA_MODEL=qwen2.5:1.5b
- OLLAMA_HOST=http://ollama:11434
- WHISPER_HOST=http://whisper:9000
- FRONTEND_ORIGINS=http://localhost:5173

# After
- OLLAMA_MODEL=${OLLAMA_MODEL:-qwen2.5:1.5b}
- OLLAMA_HOST=${OLLAMA_HOST:-http://ollama:11434}
- WHISPER_HOST=${WHISPER_HOST:-http://whisper:9000}
- FRONTEND_ORIGINS=${FRONTEND_ORIGINS:-http://localhost:5173,http://127.0.0.1:5173}

Dev values use ${VAR:-default} so they work out of the box if .env.dev is missing a key. The actual values live in docker/.env.dev (gitignored, generated from docker/.env.example via make init).

Persistent volumes for data. The old compose mounted the entire source tree and stored the SQLite DB at ~/.fireform via a named volume. Uploaded PDFs landed in data/inputs inside the source mount no volume, so a container rebuild wiped them.

# Before - DB persisted, uploads not
volumes:
  - .:/app
  - fireform_db:/root/.fireform

# After - both persisted, paths controlled by env
volumes:
  - ../..:/app          # source mount kept for hot reload
  - fireform_db:/data/db
  - fireform_uploads:/data/uploads

The app reads FIREFORM_DB_PATH and FIREFORM_DATA_DIR from env (both in config.py already). Those are now pointed at the mounted volume paths.

Ollama and Whisper hosts are env vars. If someone wants to run Ollama on a separate GPU box they can point OLLAMA_HOST at it without touching the compose file.

Fixes: #514
Part of #512
Discussion: #501

abhishek-8081 pushed a commit that referenced this pull request Jun 5, 2026
…ion setup. added init-env, select ollama model scripts. Updated docker compose path proposed in #526 and #527
@marcvergees marcvergees merged commit 63d176f into fireform-core:development Jun 6, 2026
@chetanr25 chetanr25 mentioned this pull request Jun 7, 2026
4 tasks
@chetanr25 chetanr25 deleted the docker_dev branch June 12, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants