File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11FROM node:16
22
3+ # Create app user and group
4+ RUN groupadd -g 1001 appgroup \
5+ && useradd -u 1001 -g appgroup -m appuser
6+
37WORKDIR /usr/src/app
48
59# Switch old repos to archive repos
@@ -23,15 +27,17 @@ RUN apt-get update && apt-get install -y fonts-noto-core fontconfig wget && mkdi
2327# Verify fonts are installed
2428RUN fc-list | grep -i kannada
2529
26- RUN mkdir -p /usr/src/app/user_upload
27- RUN mkdir -p /usr/src/app/logs
30+ RUN mkdir -p /usr/src/app/user_upload \
31+ && mkdir -p /usr/src/app/logs \
32+ && chown -R appuser:appgroup /usr/src/app
2833
2934COPY package*.json ./
3035RUN npm install --only=production
3136RUN npm install -g typescript@5.2.2
3237COPY . .
38+ RUN chown -R appuser:appgroup /usr/src/app
3339RUN npm run build
3440EXPOSE 3000
35-
41+ USER appuser
3642CMD [ "node" , "dist/app.js" ]
3743
You can’t perform that action at this time.
0 commit comments