diff --git a/.woodpecker.yml b/.woodpecker.yml index 3c48afa..07e3a74 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -49,6 +49,10 @@ pipeline: script: - cd /home/mnisyif/docker-containers/mnisyif/frontend - VERSION=$(cat version.txt) + - echo "Nginx configuration:" + - cat nginx.conf + - echo "Contents of dist directory:" + - ls -la dist # Stop and remove the existing container if it exists - docker stop frontend || true - docker rm frontend || true @@ -62,6 +66,12 @@ pipeline: - docker ps | grep frontend || echo "Container failed to start" # Display container logs - docker logs frontend + # Test Nginx configuration + - docker exec frontend nginx -t + # Check Nginx process + - docker exec frontend ps aux | grep nginx + # Check contents of /usr/share/nginx/html in the container + - docker exec frontend ls -la /usr/share/nginx/html # Clean up unused containers, images, and volumes - docker system prune -f --volumes # Tag the running container with the version diff --git a/nginx.conf b/nginx.conf index 02e7eab..09905f1 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,16 +1,19 @@ - -server { - listen 80; - server_name localhost; - - location / { - root /usr/share/nginx/html; - index index.html; - try_files $uri $uri/ /index.html; - } -} - - events { worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html; + try_files $uri $uri/ /index.html; + } + } } \ No newline at end of file