feat: add .dockerignore and update Dockerfile for improved caching

This commit is contained in:
2025-08-05 22:40:17 +03:00
parent 573f50acc1
commit 1047a0b5fe
2 changed files with 23 additions and 2 deletions

21
.dockerignore Normal file
View File

@ -0,0 +1,21 @@
.storybook
tests
__tests__
*.spec.ts
*.test.ts
node_modules
.yarn/cache
.eslint
.prettier
.stylelint
.env
.idea
.git
.gitignore
Dockerfile
README.md
*.log
test
docs
coverage
*.map

View File

@ -1,4 +1,4 @@
FROM node:18-alpine AS base FROM node:lts-alpine AS base
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM base AS deps
@ -10,7 +10,7 @@ RUN corepack enable
COPY .yarn ./.yarn COPY .yarn ./.yarn
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .yarnrc.yml ./ COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .yarnrc.yml ./
RUN yarn --frozen-lockfile RUN yarn && rm -rf .yarn/cache .yarn/unplugged .yarn/build-state.yml
# Rebuild the source code only when needed # Rebuild the source code only when needed