-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak Dockerfile tweaks
- Loading branch information
Showing
4 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
*.md | ||
.env* | ||
.git | ||
.idea | ||
.config | ||
.npm | ||
.github | ||
.DS_Store | ||
.gitignore | ||
.scannerwork | ||
.editorconfig | ||
certs | ||
LICENSE | ||
nodemon.json | ||
node_modules | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
FROM node:18-alpine | ||
|
||
LABEL maintainer="HifiWifi LLC" | ||
|
||
# Set the working directory | ||
WORKDIR /usr/src/app | ||
|
||
RUN apk add --no-cache python3 | ||
|
||
# Copy source code | ||
COPY package*.json ./ | ||
|
||
# Copy the rest of your app's source code from your host to your image filesystem. | ||
COPY . . | ||
|
||
# Running npm install | ||
# RUN npm install --omit=dev | ||
RUN npm install | ||
|
||
# Create a user group 'nodegroup', create a user 'nodeuser' under 'nodegroup' and chown all the files to the app user. | ||
RUN addgroup -S nodegroup && \ | ||
adduser -S -D -h /usr/src/app nodeuser nodegroup && \ | ||
chown -R nodeuser:nodegroup /usr/src | ||
|
||
# Switch to 'nodeuser' | ||
USER nodeuser | ||
|
||
# Open the mapped port | ||
EXPOSE 3000 | ||
|
||
CMD [ "./node_modules/.bin/fastify", "start", "app.js" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters