SvelteKit + Docker
Multi-stage Dockerfile: nginx for static sites, a Node server for apps that need one. This page shows exactly what pickstack adds to a SvelteKit project for Docker: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.
$ npm create pickstack@latest my-app -- --framework sveltekit --modules docker --yesCustomize in the configurator
New files
node_modules dist build .output .nuxt .next .svelte-kit .astro .angular .git .env .env.* !.env.example *.log Dockerfile .dockerignore
# syntax=docker/dockerfile:1 FROM node:24-alpine AS build WORKDIR /app COPY package.json package-lock.json* ./ RUN npm install COPY . . RUN npm run build FROM nginx:1.29-alpine COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=build /app/build /usr/share/nginx/html EXPOSE 80
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Hashed file names change with every build, so they can be cached for good.
location /_app/immutable/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
location / {
try_files $uri $uri.html $uri/ =404;
}
error_page 404 /404.html;
}
Project files
.dockerignore.gitignoreDockerfileREADME.mdnginx.confpackage.jsonsrc/app.d.tssrc/app.htmlsrc/lib/Counter.sveltesrc/lib/index.tssrc/routes/+layout.sveltesrc/routes/+layout.tssrc/routes/+page.sveltesrc/routes/about/+page.sveltesrc/routes/layout.cssstatic/robots.txttsconfig.jsonvite.config.ts