add docker file

This commit is contained in:
2026-05-03 07:37:30 +03:30
parent 86b393e34f
commit a94a46ad98
2 changed files with 48 additions and 0 deletions

22
.dockerignore Normal file
View File

@@ -0,0 +1,22 @@
node_modules
dist
coverage
.git
.gitignore
.dockerignore
Dockerfile
README.md
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.env
.env.*
.vscode
.idea
.DS_Store
*.log
tmp
temp
.temp
.tmp

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM node:22-alpine AS base
WORKDIR /app
FROM base AS deps
COPY package*.json ./
RUN npm ci
FROM deps AS build
COPY . .
RUN mkdir -p uploads
RUN npm run build
RUN npm prune --omit=dev
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /app/package*.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/src/templates ./src/templates
COPY --from=build /app/uploads ./uploads
EXPOSE 4000
CMD ["npm", "run", "start:prod"]