Skip to content

cloud-cli/image-vite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js image for Vite apps

This is a Node.js base image for Cloudy

Usage

First, create a project:

  • main.ts:
import { createApp } from "vue";
import App from "./App.vue";

createApp(App).mount("#app");
  • index.html
<div id="app"></div>
<script type="module" src="src/main.ts"></script>
  • App.vue
<template>
  <div>Hello, {{ name }}!</div>
</template>

<script setup>
const name = 'world';
</script>

Then run a build

docker run --rm -v $PWD:/home/app ghcr.io/cloud-cli/vite:latest build

Creating a container

After build, create a Dockerfile

FROM ghcr.io/cloud-cli/node:latest
ADD . /home/app

Then build the image:

docker build -t my-app .

The app is now ready to run or publish!

Run app preview

docker run --rm -p 80:8080 -e PORT=8080 -v $PWD:/home/app ghcr.io/cloud-cli/vite:latest preview

About

Base image for Vite apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Shell 35.0%
  • JavaScript 27.7%
  • Dockerfile 18.9%
  • TypeScript 10.9%
  • Vue 4.5%
  • HTML 3.0%