Files
kami_apple_exchage/frontend/build-docker.sh
danial d6e96897f4 style: enhance SCSS styles for improved readability and consistency
- Refactored SCSS styles in apple-system-components.module.scss for better formatting and added backdrop filters.
- Updated glass-components.module.scss to include backdrop filters and improve visual effects.
- Modified main.module.scss to ensure consistent text size adjustments and backdrop filters across components.
- Improved glass.module.scss with consistent text size adjustments and enhanced visual styles.
- Refined mixins.module.scss for better readability and consistency in conditional statements.
- Changed TypeScript target version in tsconfig.json from ES2023 to ES2022 for compatibility.
2025-09-10 00:04:03 +08:00

95 lines
2.2 KiB
Bash

#!/bin/bash
# Docker build script for Next.js frontend application
set -e
# Default values
IMAGE_NAME="kami-frontend"
IMAGE_TAG="latest"
DOCKERFILE="Dockerfile"
BUILD_CONTEXT="."
PUSH=false
NO_CACHE=false
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
-n|--name)
IMAGE_NAME="$2"
shift 2
;;
-t|--tag)
IMAGE_TAG="$2"
shift 2
;;
-f|--file)
DOCKERFILE="$2"
shift 2
;;
-c|--context)
BUILD_CONTEXT="$2"
shift 2
;;
-p|--push)
PUSH=true
shift
;;
--no-cache)
NO_CACHE=true
shift
;;
-h|--help)
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " -n, --name NAME Docker image name (default: kami-frontend)"
echo " -t, --tag TAG Docker image tag (default: latest)"
echo " -f, --file FILE Dockerfile path (default: Dockerfile)"
echo " -c, --context DIR Build context directory (default: .)"
echo " -p, --push Push image to registry after build"
echo " --no-cache Build without cache"
echo " -h, --help Show this help message"
exit 0
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
# Construct full image name
FULL_IMAGE_NAME="${IMAGE_NAME}:${IMAGE_TAG}"
echo "Building Docker image: ${FULL_IMAGE_NAME}"
echo "Dockerfile: ${DOCKERFILE}"
echo "Build context: ${BUILD_CONTEXT}"
# Build arguments
BUILD_ARGS=(
"--file" "${DOCKERFILE}"
"--tag" "${FULL_IMAGE_NAME}"
)
if [ "$NO_CACHE" = true ]; then
BUILD_ARGS+=("--no-cache")
fi
BUILD_ARGS+=("${BUILD_CONTEXT}")
# Build the Docker image
echo "Starting Docker build..."
docker build "${BUILD_ARGS[@]}"
# Show built image
echo "Built image details:"
docker images "${FULL_IMAGE_NAME}"
# Push to registry if requested
if [ "$PUSH" = true ]; then
echo "Pushing image to registry..."
docker push "${FULL_IMAGE_NAME}"
fi
echo "Build completed successfully!"
echo "Image: ${FULL_IMAGE_NAME}"