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
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Multimodal Toolkit",
"dockerComposeFile": [
"../docker-compose.yml"
],
"service": "app",
"workspaceFolder": "/app",
"workspaceMount": "source=${localWorkspaceFolder},target=/app,type=bind,consistency=cached",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],
"settings": {
"python.defaultInterpreterPath": "/opt/venv/bin/python",
"python.testing.pytestEnabled": true
}
}
},
"remoteUser": "root"
}
Comment on lines +20 to +22
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git
.idea
__pycache__
*.pyc
.venv
.env
Comment on lines +1 to +6
data/
*.db
*.sqlite
*.sqlite3
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python: mmt-ingest",
"type": "python",
"request": "launch",
"module": "multimodal_toolkit.pipeline.ingest",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python: mmt-analyze",
"type": "python",
"request": "launch",
"module": "multimodal_toolkit.pipeline.analyze",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
50 changes: 50 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM python:3.12-slim

# Switch to Tsinghua mirror for faster APT downloads and to avoid 502 errors
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources
Comment on lines +3 to +4

# Install necessary system dependencies for audio processing and build tools
RUN apt-get update && apt-get install -y \
build-essential \
libsndfile1 \
ffmpeg \
curl \
git \
wget \
&& rm -rf /var/lib/apt/lists/*
Comment on lines +6 to +14

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

Comment on lines +16 to +18
# Set working directory
WORKDIR /app

# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1

# Use Tsinghua mirror to speed up package downloads in China
ENV UV_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"

# Create virtual environment outside the workspace so it is not shadowed by host volume mounts
ENV UV_PROJECT_ENVIRONMENT="/opt/venv"

# Copy dependency files first for caching
COPY pyproject.toml uv.lock ./
COPY README.md ./

Comment on lines +31 to +34
# Install dependencies into the virtualenv
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-install-project --no-dev

# Copy the rest of the application code
COPY . .

# Install the application
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev

# Place executables in the environment at the front of the path
ENV PATH="/opt/venv/bin:$PATH"

# Default command (can be overridden, e.g. for running scripts)
CMD ["/bin/bash"]
Comment on lines +49 to +50
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
app:
build: .
container_name: multimodal-toolkit
environment:
- UV_COMPILE_BYTECODE=1
volumes:
- .:/app
command: tail -f /dev/null