Update test_docker.yml

This commit is contained in:
fab 2025-01-17 12:00:27 +01:00 committed by GitHub
parent daeb6d2048
commit 4eccf10943
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,32 +58,32 @@ jobs:
sudo docker pull haproxy:latest sudo docker pull haproxy:latest
sudo docker pull traefik:latest sudo docker pull traefik:latest
- name: Validate Nginx configuration # - name: Validate Nginx configuration
run: | # run: |
echo "Validating Nginx configuration..." # echo "Validating Nginx configuration..."
for file in waf_patterns/nginx/*.conf; do # for file in waf_patterns/nginx/*.conf; do
echo "Validating $file..." # echo "Validating $file..."
sudo docker run --rm -v $(pwd)/waf_patterns/nginx:/etc/nginx/conf.d:ro nginx nginx -t # sudo docker run --rm -v $(pwd)/waf_patterns/nginx:/etc/nginx/conf.d:ro nginx nginx -t
if [ $? -ne 0 ]; then # if [ $? -ne 0 ]; then
echo "Error: Validation failed for $file" # echo "Error: Validation failed for $file"
exit 1 # exit 1
fi # fi
done # done
#
# - name: Start Nginx container with WAF rules
# run: |
# echo "Starting Nginx container..."
# sudo docker run -d \
# --name nginx-waf \
# -p ${{ env.NGINX_PORT }}:80 \
# -v $(pwd)/waf_patterns/nginx:/etc/nginx/conf.d \
# nginx:latest
# echo "Nginx is running on port ${{ env.NGINX_PORT }}."
- name: Start Nginx container with WAF rules # - name: Check Nginx container logs
run: | # run: |
echo "Starting Nginx container..." # echo "Checking Nginx container logs..."
sudo docker run -d \ # sudo docker logs nginx-waf
--name nginx-waf \
-p ${{ env.NGINX_PORT }}:80 \
-v $(pwd)/waf_patterns/nginx:/etc/nginx/conf.d \
nginx:latest
echo "Nginx is running on port ${{ env.NGINX_PORT }}."
- name: Check Nginx container logs
run: |
echo "Checking Nginx container logs..."
sudo docker logs nginx-waf
- name: Validate Apache configuration - name: Validate Apache configuration
run: | run: |