Coder Social home page Coder Social logo

aprakasa / sveltekit-node-docker Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 3.0 627 KB

Home Page: https://www.youtube.com/watch?v=kVMG2nWjWk4

License: MIT License

Dockerfile 0.27% CSS 1.18% HTML 0.21% JavaScript 0.68% Svelte 11.28% TypeScript 86.37%

sveltekit-node-docker's Introduction

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.

Container

Build docker image

docker build . -t sveltekit:alpine-multistage

Run docker image

docker run -dp 5050:5050 -e PORT=5050 -e ORIGIN=http://localhost:5050 --name sveltekit-app sveltekit:alpine-multistage

SvelteKit has Block cross-site form POSTs by default. So we need to expose the ORIGIN from the environment variable.

Run the image with docker compose:

docker compose up -d

Video Explaination

https://youtu.be/kVMG2nWjWk4

sveltekit-node-docker's People

Contributors

aprakasa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sveltekit-node-docker's Issues

Unable to access Todos inside Container build

Thanks for the video and example code. Unfortunately, I'm unable to browse Todos after building and running the container following the steps in the readme. Here's what happens when I try to view Todos:

Screen Shot 2022-10-12 at 12 41 30 PM

Build error

=> ERROR [stage-1 3/5] COPY --from=builder --chown=node:node /app/build ./build

Cannot find package 'devalue'

If you do this again today?

Do you get this error?
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'devalue' imported from /app/build/server/index.js

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.