improving the dockerfile and the building

This commit is contained in:
Fernando Ontiveros
2025-04-05 16:23:05 +00:00
parent 14efc705b3
commit 9623892e79
9 changed files with 89 additions and 148 deletions

33
docker/.dockerignore Normal file
View File

@@ -0,0 +1,33 @@
# Ignore temporary files
tmp/
temp/
# Ignore Docker-related files (if you don't want them in the context)
Dockerfile
docker/
# Ignore version control files
/.git
# Ignore documentation and configuration files
INSTALL.txt
README.md
Rakefile
pmos.conf.example
# Ignore testing and feature files
tests/
features/
phpunit.xml
behat.yml.dist
phpdox.xml
env_unittest.sh
# Ignore patches and updates
patch/
update/
# Other files to ignore (customize as needed)
apiary.apib
processmaker.bat

10
docker/Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
# Use our base image
FROM gitlab.luranasoft.com:5050/luos/docker/base-image:1.0.9-php8.3
# Set the working directory
WORKDIR /code
# Copy the application code from the current directory to /code in the image
COPY . .
RUN chown -R www-data:www-data /code

26
docker/build.sh Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
# Check if the first parameter is provided
if [ -z "$1" ]; then
echo "Error: Semantic version parameter is required."
echo "Usage: $0 <semantic_version>"
exit 1
fi
echo "Building Lurana Open Source version $1"
# Update and install Composer dependencies
composer update
composer install
# Construct the Docker image tag name
tagname="gitlab.luranasoft.com:5050/pm/processmaker:$1"
echo "Docker tag name: $tagname"
# Build the Docker image using the new tag name
docker build -t "$tagname" -f ./docker/Dockerfile .
# Push the Docker image to the repository
docker push "$tagname"
echo "Build and push completed successfully."