FROM nginx:1.20.2

# Run updates and install curl package
RUN apt-get update \
    && apt-get -y upgrade \
    && apt-get install -y curl \
    && 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 entry_point.sh /usr/local/bin/entry_point.sh
RUN  chmod 755 /usr/local/bin/entry_point.sh

# Expose ports
EXPOSE 80

ENTRYPOINT  ["/usr/local/bin/entry_point.sh"]
