Skip to content

Commit

Permalink
Some config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanvicente committed Jan 30, 2024
1 parent 477544b commit be73b74
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM nginx:stable-alpine
COPY nginx_conf/nginx.conf /etc/nginx/nginx.conf
COPY dist/* /usr/share/nginx/html/

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
46 changes: 46 additions & 0 deletions build_Docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh
# Start parameters:
# 1.-fileConfig
# Example: ./build_Docker.sh ./nginx_conf/.env.dev

# Init variables
fileConfig=$1;
now="$(date +'%d-%m-%Y %H:%M:%S:%3N')"
base_dir=`pwd`

# Load environment variables
if [ -f "$fileConfig" ]
then
echo ""
echo " Loading config from $fileConfig"
echo ""

while IFS='=' read -r key value
do
key=$(echo $key | tr '.' '_')
eval ${key}='${value}'
done < "$fileConfig"

echo " Date: "${now}
echo " ======================================================"
echo ""
echo " Initializing variables "
echo ""
echo " ======================================================"
echo " REGISTRY_NAME="${REGISTRY_NAME}

else
echo "$fileConfig not found."
fi

#./gradlew :itachallenge-challenge:clean && ./gradlew :itachallenge-challenge:build

ng build --configuration production

docker build -t=${REGISTRY_NAME}:nginx-itachallenge-${NGINX_FRONTEND_TAG} .

#upload image to DockerHub
if [ ${ENV} = "dev" ] || [ ${ENV} = "pre" ];
then
docker push ${REGISTRY_NAME}:nginx-itachallenge-${NGINX_FRONTEND_TAG}
fi
Binary file added conf/.env.dev
Binary file not shown.
3 changes: 3 additions & 0 deletions conf/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.env.d* filter=git-crypt diff=git-crypt
.env.p* filter=git-crypt diff=git-crypt
.gitattributes !filter !diff
Empty file removed docker/Dockerfile
Empty file.
Binary file removed docker/nginx_conf/nginx.conf
Binary file not shown.
File renamed without changes.
Binary file added nginx_conf/nginx.conf
Binary file not shown.
File renamed without changes.

0 comments on commit be73b74

Please sign in to comment.