sveltekit-docker-deployment/README.md

28 lines
798 B
Markdown
Raw Normal View History

2024-08-28 15:26:50 +12:00
# sveltekit-docker-deployment
A recipe for deploying a SvelteKit app via Docker Compose.
This project owes a lot to [this reference](https://medium.com/@loic.joachim/dockerize-sveltekit-with-node-adapter-62c5dc6fc15a).
2024-08-30 14:29:07 +12:00
## To set up your SvelteKit project, ensure that your svelte.config.js file has this line:
// import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-node';
and then run
npm i -D @sveltejs/adapter-node
npm i dotenv
## To build a new image
docker-compose build
## To start it up (and tail the logs - CTRL-C to quit out of the logs without affecting running container)
docker-compose up -d && docker-compose logs -f
## To clear out an old image (if it's running)
docker-compose down --remove-orphans --rmi 'all'