Skip to content

Commit

Permalink
Harden dockerfile
Browse files Browse the repository at this point in the history
- Updated node alpine image version with explicit digest
- Optimized node tooling for production
- Changed ownership of copied files
- Updated .dockerignore
  • Loading branch information
duggalsu committed Sep 5, 2023
1 parent ce86f6a commit 5dc0fe8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion browser-extension/api-server/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.dockerignore
node_modules
npm-debug.log
npm-debug.log
Dockerfile
.git
.gitignore
.npmrc
7 changes: 4 additions & 3 deletions browser-extension/api-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM node:16-alpine
FROM node:18.17.1-alpine3.18@sha256:3482a20c97e401b56ac50ba8920cc7b5b2022bfc6aa7d4e4c231755770cf892f
ENV NODE_ENV production
WORKDIR /app

COPY package.json /app/package.json
COPY --chown=node:node package.json /app/package.json
RUN cd /app
RUN npm install --ignore-scripts
RUN npm install sequelize-cli --ignore-scripts
RUN npm install -g nodemon --ignore-scripts
COPY ./entrypoint.sh /
COPY --chown=node:node ./entrypoint.sh /
RUN chmod +x /entrypoint.sh
USER node
ENTRYPOINT ["/entrypoint.sh"]
Expand Down

0 comments on commit 5dc0fe8

Please sign in to comment.