FROM nginx:alpine

# Cloud Run injects PORT (8080). nginx:alpine's entrypoint runs envsubst over
# /etc/nginx/templates/*.template into /etc/nginx/conf.d/ before starting nginx.
ENV PORT=8080
ENV NGINX_ENVSUBST_TEMPLATE_SUFFIX=.template

RUN rm -f /etc/nginx/conf.d/default.conf

COPY default.conf.template /etc/nginx/templates/default.conf.template
COPY index.html /usr/share/nginx/html/index.html

EXPOSE 8080

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