sveltekit-docker-deployment/README.md
2024-08-30 14:29:07 +12:00

798 B

sveltekit-docker-deployment

A recipe for deploying a SvelteKit app via Docker Compose.

This project owes a lot to this reference.

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'