Files
batida-landing/Dockerfile
T
mario f00bd1055d
Deploy / Build & Push (Prod) (push) Successful in 59s
Deploy / Deploy Staging (push) Successful in 51s
Deploy / Deploy Prod (push) Successful in 51s
feat: replace Tailwind CDN with static CSS build (item 20)
Multi-stage Dockerfile builds ~22KB minified CSS from Tailwind
instead of loading ~300KB JS from CDN on every request.
2026-05-04 23:09:07 -03:00

30 lines
1.0 KiB
Docker

FROM node:20-alpine AS build
WORKDIR /build
COPY input.css tailwind.config.js ./
COPY *.html ./
RUN npx tailwindcss@3 -i input.css -o output.css --minify
FROM nginx:alpine
ARG APP_URL=https://app.batida.io
COPY --from=build /build/output.css /usr/share/nginx/html/output.css
COPY index.html /tmp/index.html
COPY index.pt-br.html /tmp/index.pt-br.html
COPY vs.html /tmp/vs.html
COPY vs.pt-br.html /tmp/vs.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 && \
sed -i "s|{{APP_URL}}|${APP_URL}|g" /tmp/vs.html && \
sed -i "s|{{APP_URL}}|${APP_URL}|g" /tmp/vs.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 && \
mv /tmp/vs.html /usr/share/nginx/html/vs.html && \
mv /tmp/vs.pt-br.html /usr/share/nginx/html/pt-br/vs.html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80