Code Monkey home page Code Monkey logo

vue3-typescript-docker-template's Introduction

Vue3-TypeScript Template

1. Environment

  • Vue3 (vite)
  • TypeScript
  • Docker

2. Build

NPM

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

Visit via http://localhost:5173

Docker

Build image

docker run -t imageName:version .

Tag image

docker tag imageName:version imageName:new_version

Run image as a container

docker run -d -p 5173:5173 --name containerName imageName:version >>The port is 5173, which is set in ./vite.config.ts

Visit via http://localhost:5173

List containers

docker ps

Stop containers

docker stop containerName

Docker Compose

Build image and run it as a container

docker-compose up -d

Rebuild the image

docker-compose up --build -d

3. DevLog

Port problem Vue3(Vite) - TypeScript project running within docker container but http://localhost:8080 is out of connect. Solution configure host within ./vite.config.ts

import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
    alias: {
    '@': fileURLToPath(new URL('./src', import.meta.url))
    }
},
// localhost:port
server: {
    host: true,
    port:5173
}
})

4. Demo

Map View

map_add_marker

vue3-typescript-docker-template's People

Contributors

wjppppp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.