From b04739e927890931d4dad48443ff316e46553512 Mon Sep 17 00:00:00 2001 From: glazk0 <43091603+glazk0@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:20:20 +0100 Subject: [PATCH] fix: Docker --- .dockerignore | 43 ++++++++++++++++++++++++++++++++++--------- Dockerfile | 16 +++++++--------- pnpm-lock.yaml | 15 --------------- 3 files changed, 41 insertions(+), 33 deletions(-) diff --git a/.dockerignore b/.dockerignore index d8c5aec..00e06a7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,12 +1,37 @@ -.git +# build folder +dist/ +build/ + +# logs +logs/ +.cache +.DS_Store +npm-debug.log +yarn-debug.log +yarn-error.log + +# process data +.pid +pids +.pid-lock + +# Coverage & Test +coverage +.nyc_output + +# Dependency folder node_modules -.eslint* -.prettier* -.git* +bower_components +jspm_packages + +# Environment files +.dot + +# Editor and other files +.idea +typing +internal .vscode -README.md -Dockerfile* -docker-compose.yml -public +*.tgz +.eslintcache .svelte-kit -build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a8133e5..ccf4f0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,29 +6,27 @@ ENV PATH="$PNPM_HOME:$PATH" RUN corepack enable +COPY . /app + WORKDIR /app -COPY package.json pnpm-lock.yaml ./ - -# Dependencies Stage for Production FROM base AS deps RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile -# Build Stage FROM base AS build RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile -COPY . . - RUN pnpm run build -# Deploy Stage FROM base AS deploy -COPY --from=deps /app/node_modules /app/node_modules -COPY --from=build /app/build /app/build +WORKDIR /app + +COPY --from=build /app/build ./build +COPY --from=build /app/node_modules ./node_modules +COPY --from=build /app/package.json ./package.json # Run as non-root user USER node diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 43c2727..9d68a5a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3272,21 +3272,6 @@ packages: peerDependencies: '@sveltejs/kit': 1.x || 2.x svelte: 3.x || 4.x || >=5.0.0-next.51 - peerDependenciesMeta: - '@sinclair/typebox': - optional: true - arktype: - optional: true - joi: - optional: true - superstruct: - optional: true - valibot: - optional: true - yup: - optional: true - zod: - optional: true dependencies: '@sveltejs/kit': 2.5.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.10)(vite@5.1.1) devalue: 4.3.2