FROM nginx:alpine

ARG APP_URL=https://app.batida.io

COPY index.html /tmp/index.html
COPY index.pt-br.html /tmp/index.pt-br.html

RUN sed -i "s|{{APP_URL}}|${APP_URL}|g" /tmp/index.html && \
    sed -i "s|{{APP_URL}}|${APP_URL}|g" /tmp/index.pt-br.html && \
    mkdir -p /usr/share/nginx/html/pt-br && \
    mv /tmp/index.html /usr/share/nginx/html/index.html && \
    mv /tmp/index.pt-br.html /usr/share/nginx/html/pt-br/index.html

COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
