Add env-configurable GA/form/map; remove & artifacts; verify clone completeness

- Remove 4 stray '&' files (crawl artifact) that duplicated footer/about-us/contactus/root
- Replace hardcoded GA id, form email, map src with placeholders (GA_ID, FORM_EMAIL, GMAP_EMBED)
- Add entrypoint.sh: envsubst injects env vars into HTML at container startup
- Add .env.example + .dockerignore/.gitignore guarding .env secrets
- Google Map type A (free embed, no API key) configurable via GMAP_LAT/LNG
- Verify: all 39 pages, images (38/home), content blocks (296) match original; 0 missing assets

Full clone comparison against www.mitsuthailand.com confirms sections complete.
This commit is contained in:
2026-08-06 14:27:32 +07:00
parent e04ea1dd27
commit eea7c4780e
47 changed files with 2276 additions and 8026 deletions

View File

@@ -1,22 +1,31 @@
# Static mirror of www.mitsuthailand.com (บริษัท มิตซูชัยพร จำกัด ศูนย์มิตซูบิชิ สมุทรสาคร)
# Serves the mirrored static site with nginx.
# Host: lightweight, no backend. Works on any domain (all URLs are relative).
# Serves the mirrored static site with nginx. All URLs are relative (domain-agnostic).
# Env vars (GA_ID, FORM_EMAIL, GMAP_LAT/LNG) are injected into HTML at startup.
# Host on EasyPanel: create a Dockerfile service, port 80.
FROM nginx:1.27-alpine
# Remove default nginx site
# Remove default site content
RUN rm -rf /usr/share/nginx/html/*
# Copy the mirrored static site
COPY site/ /usr/share/nginx/html/
# Custom nginx config: SPA-style clean URLs handled by directory/index.html,
# plus reasonable caching for assets.
# Custom nginx config: clean URLs via directory/index.html + caching
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Entrypoint injects env vars (GA, form email, google map) into HTML before serving.
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Ship example env as defaults (real secrets should be provided via EasyPanel env,
# overriding these at runtime — see .env.example for keys).
COPY .env.example /etc/mitsu/.env.example
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
CMD wget -q -O /dev/null http://localhost/ || exit 1
CMD ["nginx", "-g", "daemon off;"]
# Run the entrypoint (injects env) then nginx in foreground
ENTRYPOINT ["/entrypoint.sh"]