From 4fbcf3d35abeeca584f54773a8abe363e242dc85 Mon Sep 17 00:00:00 2001 From: Draco-Lunaris-Echo Date: Sun, 7 Jun 2026 21:19:07 -0500 Subject: [PATCH] fix(docker): use Ubuntu 24.04 throughout all Dockerfile stages (#47) - Stage 1 (Rust): Replace rust:1.85-bookworm with ubuntu:24.04 + rustup stable - Stage 2 (Frontend): Replace node:20-bookworm-slim with ubuntu:24.04 + NodeSource Node.js 20 - Stage 3 (Runtime): Already ubuntu:24.04 with libssl3t64 (verified correct) - docker-compose: Change postgres:16-bookworm to postgres:16 (standard image) This aligns Docker builds with the project's target OS (Ubuntu 24.04) and matches the CI environment which runs on ubuntu-latest (24.04). --- Dockerfile | 28 ++++++++++++++++++++++++---- docker-compose.yml | 2 +- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 21d2d8a..1dcd01a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,16 +6,24 @@ # ============================================================================= # --------------------------------------------------------------------------- -# Stage 1: Rust build +# Stage 1: Rust build (Ubuntu 24.04 + rustup) # --------------------------------------------------------------------------- -FROM rust:1.82-bookworm AS rust-builder +FROM ubuntu:24.04 AS rust-builder + +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ pkg-config \ libssl-dev \ libfontconfig1-dev \ && rm -rf /var/lib/apt/lists/* +# Install Rust via rustup (stable channel, provides 1.85+) +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable +ENV PATH="/root/.cargo/bin:${PATH}" + WORKDIR /usr/src/app # Cache dependencies by building a dummy project first @@ -44,9 +52,21 @@ RUN ls -la target/release/pm-web target/release/pm-worker RUN strip target/release/pm-web target/release/pm-worker # --------------------------------------------------------------------------- -# Stage 2: Frontend build +# Stage 2: Frontend build (Ubuntu 24.04 + Node.js 20) # --------------------------------------------------------------------------- -FROM node:20-bookworm-slim AS frontend-builder +FROM ubuntu:24.04 AS frontend-builder + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y \ + curl \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +# Install Node.js 20 via NodeSource +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ + && apt-get install -y nodejs \ + && rm -rf /var/lib/apt/lists/* WORKDIR /usr/src/app/frontend COPY frontend/package.json frontend/package-lock.json ./ diff --git a/docker-compose.yml b/docker-compose.yml index ee7286b..7d79ea2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: db: - image: postgres:16-bookworm + image: postgres:16 restart: unless-stopped environment: POSTGRES_USER: patch_manager