- Move Docker files to build/docker/ - Move CI/CD configs to build/ci/ - Move deployment configs to deploy/ (helm, k8s, argocd) - Move config files to config/ - Move scripts to tools/ - Consolidate assets to assets/ (Reflex compatible) - Add data/ directory for local data (gitignored) - Update all path references in Makefile, Dockerfile, CI configs - Add comprehensive README files for build/ and deploy/ - Update project documentation Benefits: - Clear separation of concerns - Cleaner root directory - Better developer experience - Enterprise-grade structure - Improved maintainability
55 lines
1.5 KiB
Docker
55 lines
1.5 KiB
Docker
# 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 <dev@peikarband.ir>"
|
|
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
|
|
|