Skip to content

Commit

Permalink
Merge pull request #3 from acceptto-corp/ECT-1327-Fix-vulnerabilities
Browse files Browse the repository at this point in the history
ECT-1327 Fix vulnerabilities
  • Loading branch information
mmalek-sa authored Feb 1, 2023
2 parents 9a6ac2b + 3afdcb1 commit e507dd6
Show file tree
Hide file tree
Showing 2 changed files with 537 additions and 394 deletions.
22 changes: 12 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ FROM node:18-alpine

WORKDIR /app

ARG PORT=3021

RUN apk add --no-cache curl && \
addgroup --gid 2000 arculix && \
adduser --uid 2000 -G arculix -D arculix && \
mkdir -p \
adduser --uid 2000 -G arculix -D arculix

COPY package*.json ./
RUN npm ci --only=production
ADD app.js geocoder.js /app/
RUN mkdir -p \
/app/geonames_dump/admin1_codes \
/app/geonames_dump/admin2_codes \
/app/geonames_dump/all_countries \
Expand All @@ -19,15 +25,11 @@ RUN apk add --no-cache curl && \
curl -L -o cities/cities1000.zip http://download.geonames.org/export/dump/cities1000.zip && \
cd all_countries && unzip allCountries.zip && rm allCountries.zip && cd .. && \
cd cities && unzip cities1000.zip && rm cities1000.zip && cd .. && \
cd alternate_names && unzip alternateNames.zip && rm alternateNames.zip


COPY package*.json ./
RUN npm ci --only=production
ADD app.js geocoder.js /app/
RUN chown -R arculix:arculix /app
cd alternate_names && unzip alternateNames.zip && rm alternateNames.zip && \
chown -R arculix:arculix /app

USER arculix

EXPOSE 3000
EXPOSE $PORT
CMD [ "npm", "start"]
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=10 CMD netstat -an | grep $PORT > /dev/null; if [ 0 != $? ]; then exit 1; fi;
Loading

0 comments on commit e507dd6

Please sign in to comment.