fix: Docker

This commit is contained in:
glazk0 2024-02-26 12:20:20 +01:00
parent 9409b71a54
commit b04739e927
No known key found for this signature in database
GPG key ID: E45BF177782B9FEB
3 changed files with 41 additions and 33 deletions

View file

@ -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 node_modules
.eslint* bower_components
.prettier* jspm_packages
.git*
# Environment files
.dot
# Editor and other files
.idea
typing
internal
.vscode .vscode
README.md *.tgz
Dockerfile* .eslintcache
docker-compose.yml
public
.svelte-kit .svelte-kit
build

View file

@ -6,29 +6,27 @@ ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable RUN corepack enable
COPY . /app
WORKDIR /app WORKDIR /app
COPY package.json pnpm-lock.yaml ./
# Dependencies Stage for Production
FROM base AS deps FROM base AS deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
# Build Stage
FROM base AS build FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build RUN pnpm run build
# Deploy Stage
FROM base AS deploy FROM base AS deploy
COPY --from=deps /app/node_modules /app/node_modules WORKDIR /app
COPY --from=build /app/build /app/build
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 # Run as non-root user
USER node USER node

15
pnpm-lock.yaml generated
View file

@ -3272,21 +3272,6 @@ packages:
peerDependencies: peerDependencies:
'@sveltejs/kit': 1.x || 2.x '@sveltejs/kit': 1.x || 2.x
svelte: 3.x || 4.x || >=5.0.0-next.51 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: dependencies:
'@sveltejs/kit': 2.5.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.10)(vite@5.1.1) '@sveltejs/kit': 2.5.0(@sveltejs/vite-plugin-svelte@3.0.2)(svelte@4.2.10)(vite@5.1.1)
devalue: 4.3.2 devalue: 4.3.2