# Base Image for Peikarband Projects # # This Dockerfile should be in a SEPARATE repository: peikarband/base # It's kept here for reference only. # # Purpose: Pre-installed build tools (Python, Node.js, bun, gcc, etc.) # Registry: hub.peikarband.ir/peikarband/base:latest # # This image is built once and cached, making subsequent builds much faster # All Peikarband projects should use this base image ARG PYTHON_VERSION=3.11 ARG NODE_VERSION=20 FROM python:${PYTHON_VERSION}-slim AS base LABEL maintainer="Peikarband Team " LABEL description="Base image with Python, Node.js, bun, and build tools" WORKDIR /build # Install build dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ g++ \ make \ curl \ gnupg \ ca-certificates \ unzip \ && rm -rf /var/lib/apt/lists/* # Install Node.js (required for Reflex) RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ && rm -rf /var/lib/apt/lists/* # Install bun (required by Reflex for frontend build) # Retry mechanism for network issues RUN set -ex && \ for i in 1 2 3 4 5; do \ curl -fsSL https://bun.sh/install | bash && break || \ (echo "Attempt $i failed, retrying in 5 seconds..." && sleep 5); \ done || (echo "Failed to install bun after 5 attempts" && exit 1) # Add bun to PATH ENV PATH="/root/.bun/bin:${PATH}" # Verify installations RUN python --version && \ node --version && \ npm --version && \ bun --version