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
39 changes: 16 additions & 23 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
FROM python:3.11-slim AS base
FROM python:3.11-slim-trixie AS base
COPY --from=ghcr.io/astral-sh/uv:0.9.5 /uv /uvx /bin/
LABEL maintainer="emilcode-dev"

# Poetry environment
# https://python-poetry.org/docs/configuration/#using-environment-variables
ENV POETRY_VERSION=2.2.1 \
POETRY_HOME="/opt/poetry" \
# do not ask any interactive question
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false

ENV PATH="$POETRY_HOME/bin:$PATH"
ENV UV_LINK_MODE=copy

# Additional dev tooling (e.g. Git, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*

# install poetry - respects $POETRY_VERSION & $POETRY_HOME
RUN curl -sSL https://install.python-poetry.org | python3 -

# Set working directory
WORKDIR /workspace

# Copy only dependency-related files first (for better build caching)
COPY ./poetry.lock ./pyproject.toml ./

# Install only runtime dependencies (without dev dependencies)
RUN poetry install --only main --no-root
WORKDIR /workspaces

# Install dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project --no-dev

# ---- Development image ----
FROM base AS dev

RUN apt-get update && apt-get install -y --no-install-recommends \
git \
tree
tree \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install all dependencies (including dev/test/docs)
RUN poetry install --no-root
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --locked --no-install-project

# Default entrypoint — start bash
ENTRYPOINT ["/bin/bash"]
8 changes: 5 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"context": "..",
"target": "dev"
},
"mounts": [
"source=,target=/workspaces/nightingale/.venv,type=volume"
],
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -24,6 +27,5 @@
}
}
},
"postCreateCommand": "poetry install && echo 'nightingale dev container is ready!'"
}

"postCreateCommand": "uv sync --locked && echo 'nightingale dev container is ready!'"
}
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
data/
data/

# Exclude the project virtual environment from image builds
.venv
Loading