chore(docker): stack compose with env_file, no secrets in repo
Some checks failed
CI / build-and-test (pull_request) Has been cancelled

- docker-compose.stack.env for DB_* and CORS (gitignored)
- docker-compose.stack.env.example with placeholders
- .dockerignore excludes local stack env from build context

Made-with: Cursor
This commit is contained in:
Vaka.pro
2026-04-06 23:03:45 +03:00
parent d187bc776e
commit 2849b16e36
7 changed files with 128 additions and 0 deletions

22
Dockerfile.backend Normal file
View File

@@ -0,0 +1,22 @@
# Сборка из корня монорепо: docker build -f Dockerfile.backend .
FROM node:20-alpine AS deps
WORKDIR /app
COPY backend/package.json backend/package-lock.json ./
RUN npm ci
FROM deps AS build
COPY backend/tsconfig.json ./
COPY backend/src ./src
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY backend/package.json backend/package-lock.json ./
RUN npm ci --omit=dev
COPY --from=build /app/dist ./dist
COPY backend/migrations ./migrations
COPY import ./import
EXPOSE 3000
ENV PORT=3000
CMD ["node", "dist/index.js"]