FROM nginx:alpine

# 1. Remove default Nginx config
RUN rm /etc/nginx/conf.d/default.conf

# 2. Copy YOUR optimized Global Nginx config
# (Make sure this file contains 'events {}' and 'http {}' blocks)
COPY nginx.conf /etc/nginx/nginx.conf

# 3. Copy only the website files (filtered by .dockerignore)
COPY . /usr/share/nginx/html/

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]