From befb9c86b39c36981b88cf4a8229a409f0ee9f90 Mon Sep 17 00:00:00 2001 From: ejacqu22 <2057151+etiennej70@users.noreply.github.com> Date: Fri, 10 Apr 2026 10:34:51 +0200 Subject: [PATCH 1/4] chore(config): add devcontainer to ease the contribution --- .devcontainer/devcontainer.json | 60 ++++++++++++++++ .devcontainer/init-certs.sh | 17 +++++ .devcontainer/install-certs.sh | 15 ++++ .devcontainer/local-certs/.gitkeep | 0 .gitignore | 7 ++ .../styles/config/vocabularies/IDP/accept.txt | 1 + Dockerfile | 2 +- docker-compose.yml | 6 +- docs/src/contributing/development-setup.md | 70 +++++++++---------- docs/src/deployment/docker.md | 18 ++--- docs/src/getting-started/installation.md | 20 +++--- 11 files changed, 154 insertions(+), 62 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/init-certs.sh create mode 100755 .devcontainer/install-certs.sh create mode 100644 .devcontainer/local-certs/.gitkeep diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f2b958c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,60 @@ +{ + "name": "IDP Core - Java 25 Spring Boot", + "image": "mcr.microsoft.com/devcontainers/java:dev-25", + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "moby": false + }, + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/python:1": { + "version": "3.14", + "installTools": false + }, + "ghcr.io/devcontainers-extra/features/uv:1": {}, + "ghcr.io/devcontainers-extra/features/pre-commit:2": {} + }, + + "customizations": { + "vscode": { + "extensions": [ + "vscjava.vscode-java-pack", + "vmware.vscode-spring-boot", + "vscjava.vscode-lombok", + "bruno-api-client.bruno", + "yzhang.markdown-all-in-one", + "bierner.markdown-mermaid", + "redhat.vscode-yaml" + ] + } + }, + + "forwardPorts": [8084, 5437, 8000], + + "mounts": [ + "source=${localWorkspaceFolder}/.devcontainer/local-certs,target=/tmp/host-certs,type=bind,readonly", + "source=idp-core-maven-cache,target=/home/vscode/.m2,type=volume" + ], + + "initializeCommand": "bash .devcontainer/init-certs.sh || true", + "portsAttributes": { + "8000": { + "label": "Documentation Site", + "onAutoForward": "notify" + }, + "8084": { + "label": "IDP Core Application", + "onAutoForward": "notify" + }, + "5437": { + "label": "PostgreSQL Database", + "onAutoForward": "silent" + } + }, + + "onCreateCommand": "bash .devcontainer/install-certs.sh && sudo chown -R vscode:vscode /home/vscode/.m2 && bash -lc 'if command -v mvn >/dev/null 2>&1 && mvn -version 2>/dev/null | grep -q \"Apache Maven 3.9.9\"; then echo \"Maven 3.9.9 already installed, skipping download\"; else wget https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz -O /tmp/maven.tar.gz && sudo tar -xzf /tmp/maven.tar.gz -C /opt && sudo ln -sf /opt/apache-maven-3.9.9/bin/mvn /usr/local/bin/mvn && rm /tmp/maven.tar.gz; fi'", + "postCreateCommand": "cd docs && uv sync", + "postStartCommand": "docker compose up -d", + + "remoteUser": "vscode" +} diff --git a/.devcontainer/init-certs.sh b/.devcontainer/init-certs.sh new file mode 100755 index 0000000..0873376 --- /dev/null +++ b/.devcontainer/init-certs.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Runs on the HOST before container creation (initializeCommand). +# On Linux hosts with corporate SSL inspection, copies host CA certificates +# into .devcontainer/local-certs/ so they can be bind-mounted into the container. +# On macOS/Windows or hosts without those paths, this is a no-op. + +CERT_DIR="$(cd "$(dirname "$0")" && pwd)/local-certs" +mkdir -p "$CERT_DIR" + +if [ -f "/etc/ssl/certs/ca-certificates.crt" ]; then + cp "/etc/ssl/certs/ca-certificates.crt" "$CERT_DIR/" +fi + +if [ -d "/usr/local/share/ca-certificates" ]; then + find /usr/local/share/ca-certificates -maxdepth 2 -name "*.crt" \ + -exec cp {} "$CERT_DIR/" \; 2>/dev/null || true +fi diff --git a/.devcontainer/install-certs.sh b/.devcontainer/install-certs.sh new file mode 100755 index 0000000..4b77c5b --- /dev/null +++ b/.devcontainer/install-certs.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Runs inside the container during onCreateCommand. +# Installs host CA certificates (populated by init-certs.sh) into the +# container's system trust store. If no host certs were provided, this is a no-op. + +CERT_SOURCE="/tmp/host-certs" + +if [ -z "$(ls -A "$CERT_SOURCE" 2>/dev/null)" ]; then + echo "No host certificates found in $CERT_SOURCE, skipping." + exit 0 +fi + +echo "Installing host CA certificates into container trust store..." +sudo cp -rp "$CERT_SOURCE"/. /usr/local/share/ca-certificates/ +sudo update-ca-certificates diff --git a/.devcontainer/local-certs/.gitkeep b/.devcontainer/local-certs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitignore b/.gitignore index 04557c3..e7cd9be 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,13 @@ mvnw.cmd .env application-secret.* +### DevContainer ### +# Host certificates copied by .devcontainer/init-certs.sh — never commit cert files +.devcontainer/local-certs/* +!.devcontainer/local-certs/.gitkeep + +### Node.js ### +**/node_modules/ # BlueJ files *.ctxt diff --git a/.vale/styles/config/vocabularies/IDP/accept.txt b/.vale/styles/config/vocabularies/IDP/accept.txt index 30f696c..014a450 100644 --- a/.vale/styles/config/vocabularies/IDP/accept.txt +++ b/.vale/styles/config/vocabularies/IDP/accept.txt @@ -37,3 +37,4 @@ ADR ADRs npm Docusaurus +devcontainer diff --git a/Dockerfile b/Dockerfile index 7dd4bd0..b5cf518 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:25-jre-alpine +FROM eclipse-temurin:25-jre-alpine@sha256:f96a37c0896c613b4328e0e54d6fad5a2e60061cff878a7cca2be10358a6e77d ENV PORT=8080 diff --git a/docker-compose.yml b/docker-compose.yml index be4859d..5786781 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,10 @@ --- -version: "3.8" - services: postgres: - image: postgres:14 + image: postgres:18 environment: POSTGRES_USER: idpcore - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-idpcore_password} + POSTGRES_PASSWORD: idpcore_password ports: - "5437:5432" networks: diff --git a/docs/src/contributing/development-setup.md b/docs/src/contributing/development-setup.md index 5839e2c..d067916 100644 --- a/docs/src/contributing/development-setup.md +++ b/docs/src/contributing/development-setup.md @@ -3,27 +3,13 @@ title: Development Setup description: Set up your local development environment for IDP-Core --- -This guide walks you through setting up a complete development environment for IDP-Core. +This guide focuses on using the devcontainer so you don’t need local Java/Maven setup. ## Prerequisites -| Tool | Version | Purpose | -| ------ | ------- | --------------- | -| Java | 25+ | Runtime | -| Maven | 3.9+ | Build tool | -| Docker | 20.10+ | Local services | -| Git | 2.30+ | Version control | -| IDE | - | Development | - -### Verify Installation - -```bash -java -version # Should show 25+ -mvn -version # Should show 3.9+ -docker --version -git --version -pre-commit --version # If using pre-commit (recommended) -``` +- Docker 20.10+ +- Git 2.30+ +- VS Code (recommended) or JetBrains IntelliJ IDEA --- @@ -31,40 +17,48 @@ pre-commit --version # If using pre-commit (recommended) ```bash # Clone your fork -git clone https://github.com/YOUR_USERNAME/internal-developer-platform.git -cd internal-developer-platform +git clone https://github.com/YOUR_USERNAME/idp-core.git +cd idp-core # Add upstream remote -git remote add upstream https://github.com/Decathlon/internal-developer-platform.git +git remote add upstream https://github.com/decathlon/idp-core.git ``` --- -## IDE Setup +## Devcontainer Setup + +The devcontainer provides Java 25, Maven 3.9.9, Docker command-line tool, and recommended IDE extensions. -### VS Code (Recommended) +### VS Code -1. Install [VS Code](https://code.visualstudio.com/) -2. Install extensions: - - Java Extension Pack - - Maven for Java - - Docker -3. Open the project folder in VS Code -4. Import Maven projects when prompted +1. Install [VS Code](https://code.visualstudio.com/) and the **DevContainers** extension +2. Ensure Docker is running +3. Open the project folder +4. Select **Reopen in Container** (or run **DevContainers: Reopen in Container**) +5. Wait for the container build and Maven import + +### JetBrains IDEs + +1. Ensure Docker is running +2. Open the project folder +3. Choose **DevContainer** / **Open in DevContainer** +4. Wait for the container build and Maven import --- ## Start the project -For your development setup, you can refer to the Getting started documentation here: [Getting Started](getting-started.md) +Once the devcontainer is running, you have a fully set up environment. At startup, the `docker compose up` command will run the PostgreSQL database. As well, in the `docs` folder, the `uv` virtual environment is already set up. -### Pre-Commit Hooks (Optional) +### Included Tools -Install pre-commit hooks for code quality: +The devcontainer includes: -```bash -pre-commit install -``` +- Pre-commit tool (run `pre-commit install` to enable hooks) +- GH command-line tool +- Python with UV and utilities for docs site generation +- PostgreSQL database running with `docker compose` --- @@ -94,6 +88,8 @@ src/main/resources/db/local/ ### Reset Database +Within the devcontainer, you can reset the database with: + ```bash # Drop and recreate docker compose down -v @@ -143,7 +139,7 @@ pre-commit run --all-files ```bash git add . -git commit -m "feat: add my feature" +git commit -m "feat(scope): add my feature" ``` ### 6. Push & Create PR diff --git a/docs/src/deployment/docker.md b/docs/src/deployment/docker.md index e6254a3..c040630 100644 --- a/docs/src/deployment/docker.md +++ b/docs/src/deployment/docker.md @@ -18,8 +18,8 @@ Deploy IDP-Core using Docker for development, testing, or small-scale production ### 1. Clone the Repository ```bash -git clone https://github.com/decathlon/internal-developer-platform.git -cd internal-developer-platform +git clone https://github.com/decathlon/idp-core.git +cd idp-core ``` ### 2. Start Services @@ -73,7 +73,7 @@ services: retries: 3 postgres: - image: postgres:14-alpine + image: postgres:18-alpine environment: - POSTGRES_DB=idp - POSTGRES_USER=idp @@ -106,7 +106,7 @@ docker run -d \ -e SPRING_DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/idp \ -e SPRING_DATASOURCE_USERNAME=idp \ -e SPRING_DATASOURCE_PASSWORD=idp \ - decathlon/internal-developer-platform:latest + ghcr.io/decathlon/idp-core:latest ``` ### With Volume Mounts @@ -118,7 +118,7 @@ docker run -d \ -v $(pwd)/config:/app/config:ro \ -v $(pwd)/logs:/app/logs \ -e SPRING_CONFIG_ADDITIONAL_LOCATION=/app/config/ \ - decathlon/internal-developer-platform:latest + ghcr.io/decathlon/idp-core:latest ``` ### With External Network @@ -134,7 +134,7 @@ docker run -d \ -e POSTGRES_DB=idp \ -e POSTGRES_USER=idp \ -e POSTGRES_PASSWORD=idp \ - postgres:14-alpine + postgres:18-alpine # Run IDP-Core docker run -d \ @@ -144,7 +144,7 @@ docker run -d \ -e SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/idp \ -e SPRING_DATASOURCE_USERNAME=idp \ -e SPRING_DATASOURCE_PASSWORD=idp \ - decathlon/internal-developer-platform:latest + ghcr.io/decathlon/idp-core:latest ``` --- @@ -163,10 +163,10 @@ Then build and run the Docker image: ```bash # Build -docker build -t internal-developer-platform:local . +docker build -t idp-core:local . # Run -docker run -d -p 8080:8080 internal-developer-platform:local +docker run -d -p 8080:8080 idp-core:local ``` ### Multi-stage Build diff --git a/docs/src/getting-started/installation.md b/docs/src/getting-started/installation.md index 6031df0..dbd29d5 100644 --- a/docs/src/getting-started/installation.md +++ b/docs/src/getting-started/installation.md @@ -1,21 +1,21 @@ --- title: Installation -description: Install the Internal Developer Platform to test the product +description: Install IDP-Core to test the product --- -This guide covers multiple ways to install and run the Internal Developer Platform in your local environment for testing and evaluation. +This guide covers multiple ways to install and run IDP-Core in your local environment for testing and evaluation. --- -## Using Docker (standard method) +## Using Maven (standard method) -The recommended way to get started with the Internal Developer Platform is using Docker and Docker Compose. +The recommended way to get started with IDP-Core is using Maven. 1. **Clone the Repository** ```bash - git clone https://github.com/decathlon/internal-developer-platform.git - cd internal-developer-platform + git clone https://github.com/dktunited/idp-core.git + cd idp-core ``` 2. **Start the PG database with Docker Compose** @@ -24,14 +24,12 @@ The recommended way to get started with the Internal Developer Platform is using docker-compose up -d ``` -3. **Run the Internal Developer Platform Application** +3. **Run the IDP-Core Application** - Once the database runs, start the Internal Developer Platform app by building and running it with Docker: + Once the database runs, start the IDP-Core app by building and running it with Maven: ```bash - mvn clean package -DskipTests - docker build -t idp-core . - docker run -p 8084:8084 --env SPRING_PROFILES_ACTIVE=local idp-core + mvn spring-boot:run -Dspring-boot.run.profiles=local,secret ``` The app will be accessible at `http://localhost:8084`. In particular, the OpenAPI documentation will be available at `http://localhost:8084/swagger-ui.html`. From 2cf7fcd4980b3ed5cf83eca88cbe26547faaf5d8 Mon Sep 17 00:00:00 2001 From: ejacqu22 <2057151+etiennej70@users.noreply.github.com> Date: Tue, 14 Apr 2026 16:56:03 +0200 Subject: [PATCH 2/4] fix(doc): remove IDP-Core references and upgrade docker image --- .devcontainer/devcontainer.json | 4 ++-- Dockerfile | 2 +- docs/src/deployment/docker.md | 12 ++++++------ docs/src/getting-started/installation.md | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f2b958c..98d71ff 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "IDP Core - Java 25 Spring Boot", + "name": "Decathlon Internal Developer Platform", "image": "mcr.microsoft.com/devcontainers/java:dev-25", "features": { @@ -43,7 +43,7 @@ "onAutoForward": "notify" }, "8084": { - "label": "IDP Core Application", + "label": "IDP Application", "onAutoForward": "notify" }, "5437": { diff --git a/Dockerfile b/Dockerfile index b5cf518..c2aa883 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:25-jre-alpine@sha256:f96a37c0896c613b4328e0e54d6fad5a2e60061cff878a7cca2be10358a6e77d +FROM eclipse-temurin:25-jre-alpine@sha256:f10d6259d0798c1e12179b6bf3b63cea0d6843f7b09c9f9c9c422c50e44379ec ENV PORT=8080 diff --git a/docs/src/deployment/docker.md b/docs/src/deployment/docker.md index c040630..c0c2863 100644 --- a/docs/src/deployment/docker.md +++ b/docs/src/deployment/docker.md @@ -18,8 +18,8 @@ Deploy IDP-Core using Docker for development, testing, or small-scale production ### 1. Clone the Repository ```bash -git clone https://github.com/decathlon/idp-core.git -cd idp-core +git clone https://github.com/decathlon/internal-developer-platform.git +cd internal-developer-platform ``` ### 2. Start Services @@ -118,7 +118,7 @@ docker run -d \ -v $(pwd)/config:/app/config:ro \ -v $(pwd)/logs:/app/logs \ -e SPRING_CONFIG_ADDITIONAL_LOCATION=/app/config/ \ - ghcr.io/decathlon/idp-core:latest + decathlon/internal-developer-platform:latest ``` ### With External Network @@ -144,7 +144,7 @@ docker run -d \ -e SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/idp \ -e SPRING_DATASOURCE_USERNAME=idp \ -e SPRING_DATASOURCE_PASSWORD=idp \ - ghcr.io/decathlon/idp-core:latest + decathlon/internal-developer-platform:latest ``` --- @@ -163,10 +163,10 @@ Then build and run the Docker image: ```bash # Build -docker build -t idp-core:local . +docker build -t idp:local . # Run -docker run -d -p 8080:8080 idp-core:local +docker run -d -p 8080:8080 idp:local ``` ### Multi-stage Build diff --git a/docs/src/getting-started/installation.md b/docs/src/getting-started/installation.md index dbd29d5..5ccc48d 100644 --- a/docs/src/getting-started/installation.md +++ b/docs/src/getting-started/installation.md @@ -3,19 +3,19 @@ title: Installation description: Install IDP-Core to test the product --- -This guide covers multiple ways to install and run IDP-Core in your local environment for testing and evaluation. +This guide covers multiple ways to install and run the Internal Developer Platform in your local environment for testing and evaluation. --- ## Using Maven (standard method) -The recommended way to get started with IDP-Core is using Maven. +The recommended way to get started with the Internal Developer Platform is using Maven. 1. **Clone the Repository** ```bash - git clone https://github.com/dktunited/idp-core.git - cd idp-core + git clone https://github.com/decathlon/internal-developer-platform.git + cd internal-developer-platform ``` 2. **Start the PG database with Docker Compose** @@ -24,9 +24,9 @@ The recommended way to get started with IDP-Core is using Maven. docker-compose up -d ``` -3. **Run the IDP-Core Application** +3. **Run the Internal Developer Platform Application** - Once the database runs, start the IDP-Core app by building and running it with Maven: + Once the database runs, start the Internal Developer Platform app by building and running it with Maven: ```bash mvn spring-boot:run -Dspring-boot.run.profiles=local,secret From 9a99ad8fd5ac1d49a37e8c78173771b96bf8420b Mon Sep 17 00:00:00 2001 From: ejacqu22 <2057151+etiennej70@users.noreply.github.com> Date: Tue, 14 Apr 2026 16:58:45 +0200 Subject: [PATCH 3/4] fix(doc): remove IDP-Core references --- docs/src/contributing/development-setup.md | 8 ++++---- docs/src/deployment/docker.md | 2 +- docs/src/getting-started/installation.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/src/contributing/development-setup.md b/docs/src/contributing/development-setup.md index d067916..80af42a 100644 --- a/docs/src/contributing/development-setup.md +++ b/docs/src/contributing/development-setup.md @@ -1,6 +1,6 @@ --- title: Development Setup -description: Set up your local development environment for IDP-Core +description: Set up your local development environment for the Internal Developer Platform --- This guide focuses on using the devcontainer so you don’t need local Java/Maven setup. @@ -17,11 +17,11 @@ This guide focuses on using the devcontainer so you don’t need local Java/Mave ```bash # Clone your fork -git clone https://github.com/YOUR_USERNAME/idp-core.git -cd idp-core +git clone https://github.com/YOUR_USERNAME/internal-developer-platform.git +cd internal-developer-platform # Add upstream remote -git remote add upstream https://github.com/decathlon/idp-core.git +git remote add upstream https://github.com/decathlon/internal-developer-platform.git ``` --- diff --git a/docs/src/deployment/docker.md b/docs/src/deployment/docker.md index c0c2863..8d8e67d 100644 --- a/docs/src/deployment/docker.md +++ b/docs/src/deployment/docker.md @@ -106,7 +106,7 @@ docker run -d \ -e SPRING_DATASOURCE_URL=jdbc:postgresql://host.docker.internal:5432/idp \ -e SPRING_DATASOURCE_USERNAME=idp \ -e SPRING_DATASOURCE_PASSWORD=idp \ - ghcr.io/decathlon/idp-core:latest + decathlon/internal-developer-platform:latest ``` ### With Volume Mounts diff --git a/docs/src/getting-started/installation.md b/docs/src/getting-started/installation.md index 5ccc48d..efb5f35 100644 --- a/docs/src/getting-started/installation.md +++ b/docs/src/getting-started/installation.md @@ -1,6 +1,6 @@ --- title: Installation -description: Install IDP-Core to test the product +description: Install the Internal Developer Platform to test the product --- This guide covers multiple ways to install and run the Internal Developer Platform in your local environment for testing and evaluation. From f406c817e354c780e9aa42e2599a695420031eb9 Mon Sep 17 00:00:00 2001 From: ejacqu22 <2057151+etiennej70@users.noreply.github.com> Date: Tue, 14 Apr 2026 19:33:24 +0200 Subject: [PATCH 4/4] feat(devcontainer): rework tools installation via custom Dockerfile Signed-off-by: ejacqu22 <2057151+etiennej70@users.noreply.github.com> --- .devcontainer/Dockerfile | 66 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 23 ++++-------- .github/dependabot.yml | 12 +++++- 3 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..edcf6ad --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,66 @@ +FROM mcr.microsoft.com/devcontainers/java:dev-25 + +ARG MAVEN_VERSION=3.9.9 +ARG MAVEN_BASE_URL=https://archive.apache.org/dist/maven/maven-3 + +# Use native TLS so uv respects the system CA bundle (required for corporate proxies) +ENV UV_NATIVE_TLS=1 + +# Copy corporate CA certificates from host for build-time HTTPS trust. +# These are populated by init-certs.sh (initializeCommand) on the host. +COPY local-certs/ /usr/local/share/ca-certificates/ + +# Install tools that were previously provided through Dev Container features: +# Docker-in-Docker dependencies, Docker CLI/Compose/Buildx, GitHub CLI, +# and Python tooling (uv + pre-commit). +RUN set -e; \ + \ + update-ca-certificates; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + apt-transport-https \ + ca-certificates \ + curl \ + dirmngr \ + git \ + gnupg2 \ + iptables \ + jq \ + lsb-release \ + pigz \ + python3-pip \ + python3-venv \ + sudo \ + wget; \ + \ + install -m 0755 -d /etc/apt/keyrings; \ + curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg; \ + chmod a+r /etc/apt/keyrings/docker.gpg; \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian trixie stable" > /etc/apt/sources.list.d/docker.list; \ + \ + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /etc/apt/keyrings/githubcli-archive-keyring.gpg; \ + chmod a+r /etc/apt/keyrings/githubcli-archive-keyring.gpg; \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list; \ + \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + containerd.io \ + docker-buildx-plugin \ + docker-ce \ + docker-ce-cli \ + docker-compose-plugin \ + gh; \ + mkdir -p /opt; \ + wget -q "${MAVEN_BASE_URL}/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -O /tmp/maven.tar.gz; \ + tar -xzf /tmp/maven.tar.gz -C /opt; \ + ln -sf "/opt/apache-maven-${MAVEN_VERSION}/bin/mvn" /usr/local/bin/mvn; \ + rm /tmp/maven.tar.gz; \ + mvn -version; \ + \ + python3 -m pip install --no-cache-dir --break-system-packages uv pre-commit; \ + uv python install 3.14; \ + usermod -aG docker vscode; \ + apt-mark hold docker-ce docker-ce-cli; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 98d71ff..75b7b22 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,18 +1,8 @@ { "name": "Decathlon Internal Developer Platform", - "image": "mcr.microsoft.com/devcontainers/java:dev-25", - - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": { - "moby": false - }, - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/python:1": { - "version": "3.14", - "installTools": false - }, - "ghcr.io/devcontainers-extra/features/uv:1": {}, - "ghcr.io/devcontainers-extra/features/pre-commit:2": {} + "build": { + "dockerfile": "Dockerfile", + "context": "." }, "customizations": { @@ -31,8 +21,9 @@ "forwardPorts": [8084, 5437, 8000], + "runArgs": ["--privileged"], + "mounts": [ - "source=${localWorkspaceFolder}/.devcontainer/local-certs,target=/tmp/host-certs,type=bind,readonly", "source=idp-core-maven-cache,target=/home/vscode/.m2,type=volume" ], @@ -52,9 +43,9 @@ } }, - "onCreateCommand": "bash .devcontainer/install-certs.sh && sudo chown -R vscode:vscode /home/vscode/.m2 && bash -lc 'if command -v mvn >/dev/null 2>&1 && mvn -version 2>/dev/null | grep -q \"Apache Maven 3.9.9\"; then echo \"Maven 3.9.9 already installed, skipping download\"; else wget https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz -O /tmp/maven.tar.gz && sudo tar -xzf /tmp/maven.tar.gz -C /opt && sudo ln -sf /opt/apache-maven-3.9.9/bin/mvn /usr/local/bin/mvn && rm /tmp/maven.tar.gz; fi'", + "onCreateCommand": "sudo mkdir -p /home/vscode/.m2 && sudo chown -R vscode:vscode /home/vscode/.m2", "postCreateCommand": "cd docs && uv sync", - "postStartCommand": "docker compose up -d", + "postStartCommand": "bash -lc 'if ! docker info >/dev/null 2>&1; then sudo mkdir -p /var/run /var/lib/docker && sudo nohup dockerd >/tmp/dockerd.log 2>&1 & fi; for i in $(seq 1 30); do docker info >/dev/null 2>&1 && break; sleep 1; done; docker compose up -d'", "remoteUser": "vscode" } diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ea541b4..c0a1dd0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,7 +20,7 @@ updates: pull-request-branch-name: separator: "-" - # Docker dependencies + # Root Docker dependencies - package-ecosystem: "docker" directory: "/" schedule: @@ -30,6 +30,16 @@ updates: pull-request-branch-name: separator: "-" + # Devcontainer Docker dependencies + - package-ecosystem: "docker" + directory: "/.devcontainer" + schedule: + interval: "daily" + time: "05:00" + open-pull-requests-limit: 5 + pull-request-branch-name: + separator: "-" + # GitHub Actions dependencies - package-ecosystem: "github-actions" directory: "/"