Pat Bhakta
Pat Bhakta
npm init svelte@next sveltekit-docker cd sveltekit-docker npm install @sveltejs/adapter-node@next --save-dev vi svelte.config.js # replace adapter-auto with adapter-node vi Dockerfile # add content docker build --no-cache -t sveltekit-docker:latest
# stage build FROM node:16-alpine WORKDIR /app # copy everything to the container COPY . . # clean install all dependencies RUN npm ci # remove potential security issues RUN...
# run container as command (stop with Ctrl-C*) docker run -it --rm --name sveltekit-docker -p 3000:3000 sveltekit-docker:latest # demonize container (send to background) docker run -d --name sveltekit-docker -p 3000:3000...
``` FROM node:18.1.0-alpine3.15 AS builder WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . RUN npm run build && npm prune --production FROM node:18.1.0-alpine3.15 USER node:node WORKDIR...