  
FROM nginx:1.29

# Run updates and install curl package
RUN apt-get update \
  && apt-get -y upgrade \
    && apt-get -y install curl \
    && apt-get -y autoremove \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Remove the default Nginx configuration file
RUN rm -v /etc/nginx/nginx.conf

# Copy a configuration file from the current directory
COPY nginx.conf /etc/nginx/
COPY js/auth0Redirect.js /etc/nginx/njs/
# TODO: isnt this copying?
COPY html/pullrequests_index.html /usr/share/nginx/html/

COPY entry_point.sh /usr/local/bin/entry_point.sh
RUN  chmod 755 /usr/local/bin/entry_point.sh

# Expose ports
EXPOSE 80

# Use the entrypoint scipt to seed DNS servers before running nginx
ENTRYPOINT  ["/usr/local/bin/entry_point.sh"]
