# Mineflappy — Minecraft Flappy Bird
# A single static page served by nginx. No build step, no Node runtime.
FROM nginx:1.27-alpine

LABEL org.opencontainers.image.title="Mineflappy" \
      org.opencontainers.image.description="Minecraft Flappy Bird - single file static game" \
      org.opencontainers.image.licenses="MIT"

# Replace nginx's placeholder page with the game + PWA shell
RUN rm -f /usr/share/nginx/html/index.html
COPY index.html        /usr/share/nginx/html/index.html
COPY manifest.webmanifest /usr/share/nginx/html/manifest.webmanifest
COPY sw.js             /usr/share/nginx/html/sw.js
COPY icon-192.png      /usr/share/nginx/html/icon-192.png
COPY icon-512.png      /usr/share/nginx/html/icon-512.png
COPY apple-touch-icon.png /usr/share/nginx/html/apple-touch-icon.png
COPY favicon-32.png     /usr/share/nginx/html/favicon-32.png
COPY nginx.conf        /etc/nginx/conf.d/default.conf

EXPOSE 80

# Coolify/Traefik use this to decide the container is live
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
  CMD wget -q --spider http://127.0.0.1/ || exit 1

CMD ["nginx", "-g", "daemon off;"]
