Skip to content

Commit a2b35e1

Browse files
committed
fix: resolve Docker build nesting issue and update version to 1.4.1
1 parent 513f34b commit a2b35e1

5 files changed

Lines changed: 29 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ Keep a Changelog format.
1717
- `docker-compose.prod.yml` — production overlay, adds Traefik labels and joins the Traefik Docker network.
1818
- **Docker:** Production deployment now supports Traefik reverse proxy with automatic Let's Encrypt HTTPS via TLS-ALPN-01 challenge. Configure via `.env` (see `.env.example`).
1919

20+
### 🐛 Fixes
21+
- **Docker build:** Fixed an issue where the `backend/` directory was copied into the image with an extra nesting level, causing import errors. The `COPY` instruction now correctly places the backend files at the root of the image filesystem.
22+
- **Versioning:** Updated the `VERSION` file to `1.4.1` to reflect the latest patch release.
23+
24+
2025
---
2126

2227
## [1.4.0] - 2026-04-06

Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,27 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313
libavutil-dev \
1414
&& rm -rf /var/lib/apt/lists/*
1515

16-
COPY backend/requirements.txt .
16+
COPY backend/requirements.txt /tmp/requirements.txt
1717

1818
# Install CPU-only PyTorch from the official CPU index
1919
# to avoid pulling CUDA-linked wheels (libnppicc, libnvrtc etc.)
2020
# torchcodec is installed from PyPI via requirements.txt but its C extension
2121
# is mocked at runtime in main.py (no CPU aarch64 wheel exists).
2222
RUN pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu
23-
RUN pip install --no-cache-dir -r requirements.txt
23+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
2424

25-
COPY backend/ .
26-
COPY frontend/ ./frontend/
25+
# Preserve backend/ as a subdirectory so it is importable as the 'backend'
26+
# package (matching the venv layout where run.py adds backend/ to sys.path).
27+
COPY backend/ backend/
28+
COPY frontend/ frontend/
2729

28-
RUN mkdir -p uploads
30+
# Temp staging area for uploaded files before they are moved to STORAGE_ROOT.
31+
RUN mkdir -p backend/uploads
32+
33+
# Make every module inside backend/ importable by its short name (state, pipeline,
34+
# etc.) exactly as run.py does by inserting backend/ into sys.path.
35+
# /app is WORKDIR so 'from backend import X' also resolves via namespace package.
36+
ENV PYTHONPATH=/app/backend
2937

3038
EXPOSE 8002
3139

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.1
1+
1.4.1

docker-compose.override.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Local development overrides — loaded automatically by `docker compose up`.
2-
# Exposes the app directly on port 8002 without needing Traefik.
2+
# Exposes the app directly on port 8002 without needing Traefik, and
3+
# bind-mounts the frontend directory for hot-reloading during development.
4+
# In production (docker-compose.prod.yml) the frontend baked into the image is used.
35
services:
46
audioscript:
57
ports:
68
- "8002:8002"
9+
volumes:
10+
- ./frontend:/app/frontend:ro

docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ services:
22
audioscript:
33
build: .
44
volumes:
5-
- ./frontend:/app/frontend:ro
65
- whisper_models:/root/.cache/huggingface
76
- amicoscript_settings:/root/.amicoscript
87
environment:
98
- PYTHONUNBUFFERED=1
109
- HF_TOKEN=${HF_TOKEN:-}
10+
# Mirror the sys.path insertion that run.py performs in venv mode so that
11+
# short-name imports (state, pipeline, …) and 'from backend import X'
12+
# both resolve correctly inside the container.
13+
- PYTHONPATH=/app/backend
1114
restart: unless-stopped
1215

1316
volumes:
17+
1418
whisper_models:
1519
amicoscript_settings:

0 commit comments

Comments
 (0)