feat: add Dockerfile

This commit is contained in:
max_richter 2023-10-19 01:03:40 +02:00
parent 481dfaf201
commit dde2fda80a
5 changed files with 586 additions and 435 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
node_modules
.git
.gitignore
*.md
build

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
FROM base AS prod-deps
RUN pnpm --version
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/build /app/build
EXPOSE 3000
CMD [ "node", "build" ]

View File

@ -29,6 +29,7 @@
},
"type": "module",
"dependencies": {
"@sveltejs/adapter-node": "^1.3.1",
"svelte-particles": "^2.12.0",
"tsparticles": "^2.12.0",
"tsparticles-confetti": "^2.12.0",

975
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */