# Edge reverse proxy for topup.kedebah.com (+ optional finance.topup.kedebah.com).
# Terminates TLS (when certs exist) and routes to commerce / finance / reverb.
# Build context = this deployment repository.
FROM nginx:1.27-alpine

# Remove the stock default server so ours is authoritative.
RUN rm -f /etc/nginx/conf.d/default.conf

COPY docker/edge/nginx.conf         /etc/nginx/nginx.conf
COPY docker/edge/00-map.conf        /etc/nginx/conf.d/00-map.conf
COPY docker/edge/00-upstreams.conf  /etc/nginx/conf.d/00-upstreams.conf
COPY docker/edge/snippets/          /etc/nginx/snippets/
COPY docker/edge/templates/         /etc/nginx/templates-src/
COPY docker/edge/40-kedebah-edge.sh /docker-entrypoint.d/40-kedebah-edge.sh
RUN chmod +x /docker-entrypoint.d/40-kedebah-edge.sh
