Added requirements for faster builds
This commit is contained in:
30
DockerBuildPush.sh
Normal file
30
DockerBuildPush.sh
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Get the directory of the script (which should be the root of your repo)
|
||||||
|
SCRIPT_DIR=$(dirname "$(realpath "$0")")
|
||||||
|
|
||||||
|
# Set variables
|
||||||
|
FULL_IMAGE_NAME="registry.gitlab.com/sascha3333/python-uv-base:latest"
|
||||||
|
|
||||||
|
# Pull the latest changes from the Git repository
|
||||||
|
echo "Pulling the latest changes from the Git repository..."
|
||||||
|
git pull origin main
|
||||||
|
|
||||||
|
# Enable BuildKit for multi-platform builds
|
||||||
|
export DOCKER_BUILDKIT=1
|
||||||
|
|
||||||
|
# Ensure Buildx is set up for multi-platform builds
|
||||||
|
echo "Setting up Buildx for multi-platform builds..."
|
||||||
|
if ! docker buildx inspect multiarch-builder > /dev/null 2>&1; then
|
||||||
|
docker buildx create --name multiarch-builder --use
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build and push the Docker image for both ARM and AMD architectures
|
||||||
|
echo "Building and pushing multi-platform Docker image..."
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/arm64,linux/amd64 \
|
||||||
|
--tag $FULL_IMAGE_NAME \
|
||||||
|
--push .
|
||||||
|
|
||||||
|
echo "Docker image built and pushed successfully: $FULL_IMAGE_NAME"
|
||||||
@@ -6,3 +6,9 @@ WORKDIR /usr/src/app
|
|||||||
|
|
||||||
# Install uv directly using pip
|
# Install uv directly using pip
|
||||||
RUN pip install uv
|
RUN pip install uv
|
||||||
|
|
||||||
|
# Common helper modules to speed up future builds
|
||||||
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
# Install dependencies using uv
|
||||||
|
RUN uv pip install --system -r requirements.txt
|
||||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
apprise
|
||||||
|
psycopg2-binary
|
||||||
Reference in New Issue
Block a user