40 - Add base image for faster CI build
All checks were successful
Build and Push Docker Image / build (push) Successful in 5m10s

This commit is contained in:
myrmidex 2026-03-07 00:27:16 +01:00
parent 005abb1877
commit 86b1fe7263
3 changed files with 56 additions and 23 deletions

View file

@ -1,26 +1,5 @@
# Production Dockerfile with FrankenPHP
FROM dunglas/frankenphp:latest-php8.3-alpine
# Install system dependencies
RUN apk add --no-cache \
nodejs \
npm \
git \
mysql-client
# Install PHP extensions
RUN install-php-extensions \
pdo_mysql \
opcache \
zip \
gd \
intl \
bcmath \
redis \
pcntl
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Production Dockerfile - uses pre-built base image
FROM forge.lvl0.xyz/lvl0/fedi-feed-router-base:latest
# Set working directory
WORKDIR /app

View file

@ -0,0 +1,24 @@
# Base image with FrankenPHP, PHP extensions, Node, and Composer
FROM dunglas/frankenphp:latest-php8.3-alpine
# Install system dependencies
RUN apk add --no-cache \
nodejs \
npm \
git \
mysql-client \
curl
# Install PHP extensions
RUN install-php-extensions \
pdo_mysql \
opcache \
zip \
gd \
intl \
bcmath \
redis \
pcntl
# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

View file

@ -81,6 +81,35 @@ pkgs.mkShell {
podman-compose -f $COMPOSE_FILE exec app php artisan "$@"
}
# ===================
# BUILD COMMANDS
# ===================
base-build() {
local image="forge.lvl0.xyz/lvl0/fedi-feed-router-base:latest"
# Check if logged in, prompt if not
if ! podman login --get-login forge.lvl0.xyz &>/dev/null; then
echo "Not logged in to forge.lvl0.xyz"
podman login forge.lvl0.xyz || return 1
fi
echo "Building base image: $image"
if ! podman build -t "$image" -f docker/build/Dockerfile.base .; then
echo "Build failed!"
return 1
fi
echo ""
echo "Pushing to registry..."
if ! podman push "$image"; then
echo "Push failed!"
return 1
fi
echo ""
echo "Done! Base image pushed: $image"
}
# ===================
# WELCOME MESSAGE
# ===================
@ -99,6 +128,7 @@ pkgs.mkShell {
echo " dev-logs-db Tail database logs"
echo " dev-shell Shell into app container"
echo " dev-artisan <cmd> Run artisan command"
echo " base-build Build and push base image"
echo ""
echo "Services:"
echo " app Laravel + Vite http://localhost:8000"