Giter Site home page Giter Site logo

adityadees / sveltekit-js-docker Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 39 KB

skelton dockerized sveltekit JS HMR dev and build multi adapter for node server and static build SSG

JavaScript 59.63% Makefile 24.34% HTML 10.59% Svelte 5.44%
development docker docker-compose dockerized hmr production svelte sveltekit vite javascript

sveltekit-js-docker's Introduction

Docker

This skelton Docker Development and Production for SvelteKit using Javascript if you prefer using Typescipt you can check this repo sveltekit-ts-docker

Docker Dev and Prod

  • If you run docker dev, this action same like npm run dev

  • If you run docker prod, this action same like npm run build

  • for production build will have two image and container (static and node)

    • If you don't have an image run this first

    • this will build a docker image

      • for development mode
        make build 
      • for deployment production mode
        make build-prod
    • (if you already have an image run this or you can just run this if you don't have image, this will automate pull an image depedency)

    • this will run the container

      • for development mode
        make up 
      • for deployment production mode
        make up-prod
    • run this if you want to stop the container

      • for development mode
        make stop
      • for deployment production mode
        make stop-prod
    • run this if you want to delete the container

      • for development mode
        make down
      • for deployment production mode
        make down-prod

note

make sure you know about the port

rules : example 5001:5173

Left is your port

Right is port inside docker

For docker port I used default port

5173 : default vite port
80 : default nginx port
3000 : default node port

you can config port for yourself

example : if you want to change vite port you can change this line "dev": "vite dev --host" inside package.json to "dev": "vite dev --host 0.0.0.0 --port 5005" and don't forget to change others 5173 to 5005


create-svelte

Everything you need to build a Svelte project, powered by create-svelte.

Creating a project

If you're seeing this, you've probably already done this step. Congrats!

# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app

Developing

Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Building

To create a production version of your app:

npm run build

You can preview the production build with npm run preview.

To deploy your app, you may need to install an adapter for your target environment.

sveltekit-js-docker's People

Contributors

adityadees avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  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.