Skip to content

Instantly share code, notes, and snippets.

@till
Created February 7, 2022 17:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save till/f1845917b8a621ec73efa6d2e8197ffb to your computer and use it in GitHub Desktop.
Save till/f1845917b8a621ec73efa6d2e8197ffb to your computer and use it in GitHub Desktop.
A static website with sveltekit
FROM node:17.0-alpine as build
ADD app /app
WORKDIR /app
RUN npm ci --fetch-timeout=600000
RUN npm run build
FROM nginx:stable
COPY --from=build /app/build /usr/share/nginx/html
// app/svelte.config.js
import adapter from '@sveltejs/adapter-static';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: 'index.html',
precompress: false
})
}
};
export default config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment