FROM nginx:1.31.2

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

# Copy a configuration file from the current directory.
COPY nginx.conf /etc/nginx/

# Add an entrypoint.
COPY entrypoint.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["nginx"]
