Skip to content
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/build-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ jobs:
docker-image-owner: makeplane
docker-image-name: ${{ needs.branch_build_setup.outputs.dh_img_backend }}
build-context: ./apps/api
dockerfile-path: ./apps/api/Dockerfile.api
dockerfile-path: ./apps/api/Dockerfile
buildx-driver: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}
buildx-version: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}
buildx-platforms: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}
Expand Down
3 changes: 3 additions & 0 deletions apps/api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
venv/
.venv/
Dockerfile
84 changes: 84 additions & 0 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Stage 1: Builder - Install dependencies with uv
FROM python:3.12.10-alpine AS builder

# Install uv
COPY --from=ghcr.io/astral-sh/uv:0.9.18 /uv /usr/local/bin/uv

# Set working directory
WORKDIR /app

# Set environment variables for uv
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy

# Install build dependencies and runtime dependencies
RUN apk add --no-cache --virtual .build-deps \
gcc \
musl-dev \
python3-dev \
linux-headers \
libpq-dev \
libxslt-dev \
xmlsec-dev \
&& apk add --no-cache \
bash \
libpq \
libxslt \
xmlsec

# 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

# Copy the project into the image
COPY . /app/
ENV PATH="/app/.venv/bin:$PATH"

# Sync the project
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked \
&& apk del .build-deps


# Optional dev environment
FROM builder AS dev
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --group local

CMD [ "./bin/docker-entrypoint-api-local.sh" ]


# Optional test environment
FROM builder AS test
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --group test


# Stage 2: Production - Lean runtime image
FROM python:3.12.10-alpine AS production

# Install only runtime dependencies
RUN apk add --no-cache \
bash \
libpq \
libxslt \
xmlsec

# Copy the virtual environment from builder
COPY --from=builder /app/.venv /app/.venv

# Copy application code
COPY --from=builder /app /app

# Set working directory
WORKDIR /app

# Set PATH to include virtual environment
ENV PATH="/app/.venv/bin:$PATH"

# Expose Django default port
EXPOSE 8000

CMD ["./bin/docker-entrypoint-api.sh"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing chmod makes entrypoint scripts non-executable

The old Dockerfile.api and Dockerfile.dev both explicitly ran chmod +x ./bin/* after copying files to ensure entrypoint scripts were executable. The new Dockerfile copies files with COPY . /code/ but never runs chmod. Both the dev and production stages use CMD to execute scripts from ./bin/ (docker-entrypoint-api.sh and docker-entrypoint-api-local.sh). If these scripts don't have execute permissions in the git repository, container startup will fail with "permission denied" errors.

Fix in Cursor Fix in Web

58 changes: 0 additions & 58 deletions apps/api/Dockerfile.api

This file was deleted.

46 changes: 0 additions & 46 deletions apps/api/Dockerfile.dev

This file was deleted.

66 changes: 63 additions & 3 deletions apps/api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,49 @@
[project]
name = "Plane"
version = "0.24.0"
description = "Open-source project management that unlocks customer value"
name = "plane-api"
version = "1.21.1"
description = "Open-source project management that unlocks customer value - Django backend component"
requires-python = ">=3.12"
dependencies = [
"beautifulsoup4>=4.12,<5.0.0",
"boto3>=1.34.96,<2.0.0",
"celery>=5.4.0,<6.0",
"channels>=4.1.0,<5.0",
"cryptography>=44.0.1",
"dj-database-url>=2.1.0,<3.0",
"django>=4.2.27,<5.0",
"django-celery-beat>=2.6.0,<3.0",
"django-celery-results>=2.5.1,<3.0",
"django-cors-headers>=4.3.1,<5.0",
"django-crum>=0.7.9,<1.0",
"django-filter>=24.2",
"django-redis>=5.4.0,<6.0",
"django-storages>=1.14.2,<2.0",
"djangorestframework>=3.15.2,<4.0",
"drf-spectacular>=0.28.0",
"faker==25.0.0",
"gunicorn>=23.0.0",
"jsonmodels>=2.7.0",
"lxml>=6.0.0,<7.0",
"nh3>=0.2.18,<0.3",
"openai>=1.63.2,<2.0",
"openpyxl>=3.1.2",
"opentelemetry-api>=1.28.1,<2.0",
"opentelemetry-exporter-otlp>=1.28.1,<2.0",
"opentelemetry-instrumentation-django>=0.49b1,<1.0",
"opentelemetry-sdk>=1.28.1,<2.0",
"posthog>=3.5.0,<4.0",
"psycopg-binary>=3.3.0,<4.0",
"pyjwt>=2.8.0,<3.0",
"pymongo>=4.6.3,<5.0",
"python-json-logger>=3.3.0,<4.0",
"pytz>=2024.1",
"redis>=5.0.4,<6.0",
"scout-apm>=3.1.0,<4.0",
"slack-sdk>=3.27.1,<4.0",
"uvicorn>=0.29.0,<1.0",
"whitenoise>=6.11.0,<7.0",
"zxcvbn>=4.4.28,<5.0",
]

[tool.ruff]
# Exclude a variety of commonly ignored directories.
Expand Down Expand Up @@ -94,3 +136,21 @@ convention = "google"
[tool.ruff.lint.pylint]
max-args = 8
max-statements = 50

[dependency-groups]
local = [
"django-debug-toolbar==4.3.0",
"ruff==0.9.7",
]
test = [
"coverage==7.2.7",
"factory-boy==3.3.0",
"freezegun==1.2.2",
"httpx==0.24.1",
"pytest==7.4.0",
"pytest-cov==4.1.0",
"pytest-django==4.5.2",
"pytest-mock==3.11.1",
"pytest-xdist==3.3.1",
"requests==2.32.4",
]
3 changes: 0 additions & 3 deletions apps/api/requirements.txt

This file was deleted.

73 changes: 0 additions & 73 deletions apps/api/requirements/base.txt

This file was deleted.

5 changes: 0 additions & 5 deletions apps/api/requirements/local.txt

This file was deleted.

3 changes: 0 additions & 3 deletions apps/api/requirements/production.txt

This file was deleted.

12 changes: 0 additions & 12 deletions apps/api/requirements/test.txt

This file was deleted.

Loading