1.1 KiB
1.1 KiB
name, description, license, triggers
| name | description | license | triggers | ||
|---|---|---|---|---|---|
| docker-provisioner | Generates a multi-stage Dockerfile for production builds of the Vite + React app and provides guidance for Docker Compose/CI. | MIT |
|
Docker Provisioner
When to use this skill
- Use when packaging the frontend for production or preparing a devcontainer/Codespaces image.
- Triggered by commands to create or update a
Dockerfileanddocker-compose.ymlfor static serving.
Instructions
-
First Step: Generate a multi-stage
Dockerfilethat builds the app in a Node builder stage and serves thedistvianginxor a minimal static server. -
Second Step: Optionally create
docker-compose.ymlfor local runs and include build args to pass environment variables. -
Third Step: Add CI steps to build and optionally push Docker images to GHCR or Docker Hub with secrets managed in the repository settings.
Examples
- Multi-stage Dockerfile snippet provided and notes about caching
node_moduleslayers.
Notes
- Document how to set
VITE_prefixed env vars at build time and how to usenpm run previewfor local tests.