Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor ESLint and Docker configurations for improved consistency an…
…d performance

- Updated .eslintrc to use 'readonly' for global variables for better clarity.
- Modified gulpfile.js to ensure compatibility with the latest gulp-sass version.
- Simplified Chrome executable path resolution in karma.conf.js by removing chrome-launcher dependency.
- Updated package.json to downgrade 'del' dependency and adjust 'glob' and 'glob-stream' versions.
- Enhanced Dockerfile configurations for both development and production environments, including the installation of additional packages and improved npm install commands.
- Refactored SCSS files for better readability and consistency in styling.
  • Loading branch information
RishabhJain2018 committed Sep 2, 2025
commit 2b5038a0571f5b5fb26a1576fd1e797ce71ecbfb
42 changes: 22 additions & 20 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@ eslint config file.
*/

{
"env": {
"es6": 1,
"browser": 1
},
"env": {
"es6": 1,
"browser": 1
},

"globals": {
"angular":1,
"jquery": 1,
"$": 1,
"_": 1,
"moment": true
},
"globals": {
"angular": "readonly",
"jquery": "readonly",
"$": "readonly",
"_": "readonly",
"moment": "readonly"
},

"extends": "eslint:recommended",
"extends": "eslint:recommended",

"rules": {
"no-console": "warn",
"semi": ["error",
"always", {
"omitLastInOneLineBlock": true
}
],
},
"rules": {
"no-console": "warn",
"semi": [
"error",
"always",
{
"omitLastInOneLineBlock": true
}
]
}
}
6 changes: 4 additions & 2 deletions docker/dev/nodejs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ RUN npm install -g bower gulp gulp-cli karma-cli qs --no-audit --no-fund --progr
npm cache clean -f

# Install project dependencies with optimizations and progress
RUN npm install --only=production --no-audit --no-fund --prefer-offline --progress --verbose && \
bower install --allow-root
RUN npm install --only=production --no-audit --no-fund --prefer-offline --progress --verbose

# AMD64-specific stage
FROM base AS amd64
Expand All @@ -69,6 +68,9 @@ ENV DISPLAY=:99.0
# Copy source code
COPY . /code/

# Install bower components after source code is copied
RUN bower install --allow-root

# Set common command and expose port
CMD ["gulp", "dev:runserver"]
EXPOSE 8888
34 changes: 26 additions & 8 deletions docker/prod/nodejs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.19.0-bullseye AS base
FROM node:18.19.0-bullseye

ARG NODE_ENV

Expand All @@ -8,7 +8,12 @@ RUN apt-get update && \
python2 \
python-is-python2 \
make \
g++ && \
g++ \
curl \
wget \
gnupg \
ca-certificates \
xvfb && \
rm -rf /var/lib/apt/lists/*

WORKDIR /code
Expand All @@ -21,26 +26,39 @@ RUN npm config set fetch-timeout 600000 && \
npm config set fetch-retry-mintimeout 20000 && \
npm config set fetch-retry-maxtimeout 120000 && \
npm config set progress true && \
npm config set loglevel verbose
npm config set loglevel verbose && \
npm config set maxsockets 50

# Install global dependencies
RUN npm install -g bower gulp gulp-cli qs --progress && \
npm install phantomjs-prebuilt --progress && \
RUN npm install -g bower gulp gulp-cli karma-cli qs --no-audit --no-fund --progress --verbose && \
npm link gulp && \
npm cache clean -f

# Install project dependencies with optimizations
RUN npm install --only=production --no-audit --no-fund --prefer-offline --progress && \
bower install --allow-root
RUN npm install --only=production --no-audit --no-fund --prefer-offline --progress --verbose

# Copy frontend source
COPY frontend /code/frontend

# Install bower components after source code is copied
RUN bower install --allow-root

# Install Chrome for testing (if needed)
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && apt-get install -yq google-chrome-stable libxss1 && \
rm -rf /var/lib/apt/lists/*

# Set Chrome environment variables for production
ENV CHROME_BIN=/usr/bin/google-chrome
ENV CHROME_PATH=/usr/bin/google-chrome
ENV DISPLAY=:99.0

RUN gulp ${NODE_ENV}

FROM nginx:1.13-alpine
# Adding NODE_ENV here as well since this is a multistage build
ARG NODE_ENV
COPY docker/prod/nodejs/nginx_${NODE_ENV}.conf /etc/nginx/conf.d/default.conf
COPY --from=base /code /code
COPY --from=0 /code /code
COPY /ssl /etc/ssl
Loading