2026-06-05 18:56:01 +00:00
|
|
|
# FleetNow — static single-file SPA served by nginx.
|
|
|
|
|
# Coolify auto-detects this Dockerfile; set the app's port to 80 and attach
|
|
|
|
|
# the domain (fleetnow.rahamafresh.com) in the Coolify UI — Traefik + LE are
|
|
|
|
|
# wired automatically from there.
|
|
|
|
|
FROM nginx:1.27-alpine
|
|
|
|
|
|
|
|
|
|
# Drop the stock default site, add ours.
|
|
|
|
|
RUN rm -f /etc/nginx/conf.d/default.conf
|
|
|
|
|
COPY nginx.conf /etc/nginx/conf.d/fleetnow.conf
|
|
|
|
|
|
|
|
|
|
# The whole app is one self-contained file (inline CSS/JS; MapLibre from a CDN).
|
|
|
|
|
COPY index.html /usr/share/nginx/html/index.html
|
|
|
|
|
|
2026-06-10 11:14:10 +00:00
|
|
|
# Runtime API-base injection: the entrypoint renders ${API_BASE} -> /env.js at
|
|
|
|
|
# container start (envsubst ships with the nginx image). Set API_BASE per env;
|
|
|
|
|
# unset falls back to the prod API, so prod/main is unaffected.
|
|
|
|
|
COPY env.js.template /usr/share/nginx/html/env.js.template
|
|
|
|
|
COPY docker-entrypoint.d/30-fleetnow-env.sh /docker-entrypoint.d/30-fleetnow-env.sh
|
|
|
|
|
RUN chmod +x /docker-entrypoint.d/30-fleetnow-env.sh
|
|
|
|
|
|
2026-06-08 18:46:30 +00:00
|
|
|
# Static map-overlay data (toggleable layers: gas stations, etc.), served at /layers/.
|
|
|
|
|
COPY layers/ /usr/share/nginx/html/layers/
|
|
|
|
|
|
2026-06-05 18:56:01 +00:00
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
|
|
# Coolify reads this; also handy for `docker ps` health.
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
|
|
|
CMD wget -qO- http://localhost/healthz >/dev/null 2>&1 || exit 1
|