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:
parent
fac7ed2636
commit
5f20906349
182
.dockerignore
182
.dockerignore
@ -1,5 +1,177 @@
|
|||||||
**/node_modules
|
# ====================================================
|
||||||
**/dist
|
# NODE.JS & NPM
|
||||||
**/.angular
|
# ====================================================
|
||||||
**/.vscode
|
**/node_modules/
|
||||||
**/e2e
|
**/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/
|
||||||
|
|||||||
@ -1,41 +1,33 @@
|
|||||||
# ====================================================
|
# ====================================================
|
||||||
# Stage 1: builder
|
# Stage 1: builder
|
||||||
# ====================================================
|
# ====================================================
|
||||||
FROM node:22.14.0-alpine3.21 AS builder
|
FROM node:22.16.0-alpine3.21 AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
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
|
USER node
|
||||||
|
|
||||||
COPY --chown=node:node frontend/package*.json ./frontend/
|
COPY --chown=node:node frontend/package*.json ./frontend/
|
||||||
COPY --chown=node:node backend/package*.json ./backend/
|
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 . .
|
COPY --chown=node:node . .
|
||||||
|
|
||||||
WORKDIR /app/frontend
|
|
||||||
|
|
||||||
ARG BASE_HREF=/
|
ARG BASE_HREF=/
|
||||||
|
|
||||||
RUN npm install
|
# Prepare project
|
||||||
# Sync types from the types package
|
RUN chmod +x prepare.sh && \
|
||||||
RUN npm run types:sync
|
sh ./prepare.sh --typings --frontend --webcomponent --backend
|
||||||
# Build the fronted for production
|
|
||||||
RUN npm run build:prod ${BASE_HREF}
|
|
||||||
|
|
||||||
WORKDIR /app/backend
|
# Clean up
|
||||||
|
RUN rm -rf frontend/node_modules backend/node_modules && \
|
||||||
RUN npm install
|
rm -rf typings
|
||||||
# Sync types from the types package
|
|
||||||
RUN npm run types:sync
|
|
||||||
# Build the backend for production
|
|
||||||
RUN npm run build:prod
|
|
||||||
|
|
||||||
# ====================================================
|
# ====================================================
|
||||||
# Stage 2: production
|
# 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
|
WORKDIR /opt/openvidu-meet
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,7 @@ fi
|
|||||||
if [ "$BUILD_TYPINGS" = true ]; then
|
if [ "$BUILD_TYPINGS" = true ]; then
|
||||||
echo -e "${GREEN}Building types library...${NC}"
|
echo -e "${GREEN}Building types library...${NC}"
|
||||||
cd typings
|
cd typings
|
||||||
npm install
|
# npm install
|
||||||
npm run sync-ce
|
npm run sync-ce
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user