merge upstream

This commit is contained in:
2026-06-10 15:27:00 +03:30
4 changed files with 104 additions and 0 deletions

43
.dockerignore Normal file
View File

@@ -0,0 +1,43 @@
# Dependencies (reinstalled inside Docker)
node_modules
# Build output (rebuilt inside Docker)
dist
# Test & coverage
test
**/*.spec.ts
**/*.e2e-spec.ts
coverage
jest.config.*
# Environment & secrets
.env
.env.*
!.env.example
# Git
.git
.gitignore
.gitattributes
# Docker itself
Dockerfile
.dockerignore
docker-compose*.yml
# Editor & OS
.vscode
.idea
*.iml
.DS_Store
Thumbs.db
# Logs
logs
*.log
npm-debug.log*
# Misc
README.md
*.md

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# ─── Stage 0: Base ────────────────────────────────────────────────────────────
FROM node:20-alpine AS base
WORKDIR /app
# ─── Stage 1: Dependencies ───────────────────────────────────────────────────
FROM base AS deps
COPY package*.json ./
RUN npm ci
# ─── Stage 2: Builder ─────────────────────────────────────────────────────────
FROM deps AS builder
COPY . .
RUN npm run build
RUN npm ci --omit=dev --ignore-scripts
# ─── Stage 3: Production ──────────────────────────────────────────────────────
FROM base AS production
ENV NODE_ENV=production
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
COPY --from=builder --chown=appuser:appgroup /app/node_modules ./node_modules
COPY --from=builder --chown=appuser:appgroup /app/package.json ./package.json
EXPOSE 3000
CMD ["node", "dist/main"]

8
docker-compose.build.yml Normal file
View File

@@ -0,0 +1,8 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
target: production
image: ${REGISTRY_URL:-registry.ittalie.com}/${IMAGE_NAME:-shared-esg}:${IMAGE_TAG:-latest}

30
docker-compose.deploy.yml Normal file
View File

@@ -0,0 +1,30 @@
services:
app:
image: ${REGISTRY_URL:-docker.ittalie.com}/${IMAGE_NAME:-shared-esg}:${IMAGE_TAG:-latest}
container_name: shared-esg
hostname: shared-esg
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000"
env_file:
- .production.env
depends_on:
mongodb:
condition: service_healthy
mongodb:
image: docker.ittalie.com/mongo:7
container_name: shared-esg-db
hostname: shared-esg-db
restart: unless-stopped
volumes:
- esg_mongodb_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
esg_mongodb_data: