docker: update .dockerignore for comprehensive exclusion of build artifacts and development files; modify Dockerfile for improved build process and cleanup; comment out npm install in prepare.sh for types library

This commit is contained in:
Carlos Santos 2025-06-13 16:49:30 +02:00
parent fac7ed2636
commit 5f20906349
3 changed files with 188 additions and 24 deletions

View File

@ -1,5 +1,177 @@
**/node_modules
**/dist
**/.angular
**/.vscode
**/e2e
# ====================================================
# NODE.JS & NPM
# ====================================================
**/node_modules/
**/npm-debug.log*
**/yarn-debug.log*
**/yarn-error.log*
**/lerna-debug.log*
**/.npm
**/.pnpm-debug.log*
# ====================================================
# BUILD OUTPUTS & DIST
# ====================================================
**/dist/
**/build/
**/coverage/
**/.nyc_output/
**/lib-cov/
# # ====================================================
# # ANGULAR SPECIFIC
# # ====================================================
**/.angular/
# ====================================================
# TESTING & E2E
# ====================================================
**/e2e/
**/tests/screenshots/
**/tests/videos/
**/tests/results/
**/test-results/
**/playwright-report/
**/test_localstorage_state.json
**/*_current.png
**/*_mask.png
**/*.spec.js.map
**/*.test.js.map
**/cypress/
**/jest-coverage/
**/.jest/
**/testapp/
# ====================================================
# DEVELOPMENT TOOLS & EDITORS
# ====================================================
**/.vscode/
**/.idea/
**/.vs/
**/.vscode-test/
**/*.swp
**/*.swo
**/*~
**/.DS_Store
**/Thumbs.db
# ====================================================
# GIT & VERSION CONTROL
# ====================================================
**/.git/
**/.gitignore
**/.gitattributes
**/.gitmodules
# ====================================================
# LOGS & TEMPORARY FILES
# ====================================================
**/logs/
**/*.log
**/tmp/
**/temp/
**/.tmp/
**/.temp/
**/pids/
**/*.pid
**/*.seed
**/*.pid.lock
# ====================================================
# ENVIRONMENT & CONFIG
# ====================================================
**/.env
**/.env.local
**/.env.development.local
**/.env.test.local
**/.env.production.local
**/.env.*.local
# ====================================================
# DOCUMENTATION & README
# ====================================================
**/README.md
**/CHANGELOG.md
**/docs/
**/documentation/
**/*.md
**/webhooks-snippets/
# ====================================================
# LINTING & FORMATTING
# ====================================================
**/.eslintcache
**/.stylelintcache
**/.prettier*
**/.editorconfig
# ====================================================
# TYPESCRIPT
# ====================================================
**/tsconfig.tsbuildinfo
**/*.tsbuildinfo
# ====================================================
# CI/CD & DEPLOYMENT
# ====================================================
**/.github/
**/.gitlab-ci.yml
**/.travis.yml
**/.circleci/
**/jenkins/
**/azure-pipelines.yml
# ====================================================
# CERTIFICATES & KEYS
# ====================================================
**/*.pem
**/*.key
**/*.cert
**/*.p12
**/*.crt
# ====================================================
# MEDIA & ASSETS (Large files)
# ====================================================
**/*.mp4
**/*.avi
**/*.mov
**/*.mkv
**/*.webm
**/*.mp3
**/*.wav
**/*.flac
# ====================================================
# WORKSPACE & PROJECT FILES
# ====================================================
**/*.code-workspace
**/.project
**/.classpath
**/.settings/
# ====================================================
# CACHE FILES
# ====================================================
**/.cache/
**/cache/
**/.parcel-cache/
**/.next/
**/.nuxt/
**/.gatsby/
# ====================================================
# BACKEND SPECIFIC
# ====================================================
**/uploads/
**/sessions/
**/public/
# ====================================================
# FRONTEND BUILD ARTIFACTS
# ====================================================
**/webcomponent/dist/
**/webcomponent/node_modules/
**/frontend/dist/
**/frontend/.angular/

View File

@ -1,41 +1,33 @@
# ====================================================
# Stage 1: builder
# ====================================================
FROM node:22.14.0-alpine3.21 AS builder
FROM node:22.16.0-alpine3.21 AS builder
WORKDIR /app
RUN mkdir -p types frontend backend && chown -R node:node /app
RUN mkdir -p typings frontend backend && chown -R node:node /app
USER node
COPY --chown=node:node frontend/package*.json ./frontend/
COPY --chown=node:node backend/package*.json ./backend/
COPY --chown=node:node types/package*.json ./types/
COPY --chown=node:node typings/package*.json ./typings/
COPY --chown=node:node . .
WORKDIR /app/frontend
ARG BASE_HREF=/
RUN npm install
# Sync types from the types package
RUN npm run types:sync
# Build the fronted for production
RUN npm run build:prod ${BASE_HREF}
# Prepare project
RUN chmod +x prepare.sh && \
sh ./prepare.sh --typings --frontend --webcomponent --backend
WORKDIR /app/backend
RUN npm install
# Sync types from the types package
RUN npm run types:sync
# Build the backend for production
RUN npm run build:prod
# Clean up
RUN rm -rf frontend/node_modules backend/node_modules && \
rm -rf typings
# ====================================================
# Stage 2: production
# ====================================================
FROM node:22.14.0-alpine3.21 AS production
FROM node:22.16.0-alpine3.21 AS production
WORKDIR /opt/openvidu-meet

View File

@ -84,7 +84,7 @@ fi
if [ "$BUILD_TYPINGS" = true ]; then
echo -e "${GREEN}Building types library...${NC}"
cd typings
npm install
# npm install
npm run sync-ce
cd ..
fi