Svelte Project with Docker, Mysql, Redis Node

This is a docker-compose install for

  • sveltekit
  • Mysql
  • chroma
  • clickhouse
  • redis

also has npm packages installed

Get source code

git clone https://github.com/jazzjazzy/sveltekit-docker-framework.git new-directory-name

you can change the new-directory-name of the directory to whatever you want

remove the .git folder

cd new-directory-name
rm -rf .git

and the commit your own repo

git init
git add .
git commit -m "Initial commit"

# add your own repo on Github 

git remote add origin https://github.com/yourusername/yournewrepo.git
git push -u origin master

Setup .env file

cp .env.example .env

run docker and install Packages

you will need to start docker and the install the node packages

docker-compose up --build

#once the docker is running you can install the node packages

docker exec -it sveltekit npm install

run the project

you can then run the project with docker exec or npm run docker-dev they are both the same command, its just running npm run dev inside the docker container

docker exec -it sveltekit npm run dev 

#or 

npm run docker-dev

Building

To create a production version of your app:

docker exec -it sveltekit npm run build 

#or 

npm run docker-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.

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes