-
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.
Merge pull request #9 from Topsideboss2/main
Dockerizing the web app
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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,22 @@ | ||
# Choose the Image which has Node installed already | ||
FROM node:18.17-alpine | ||
|
||
# make the 'app' folder the current working directory | ||
WORKDIR /app | ||
|
||
# copy both 'package.json' and 'package-lock.json' (if available) | ||
COPY package*.json ./ | ||
|
||
# install project dependencies | ||
RUN npm install | ||
|
||
RUN npm install pm2@latest -g | ||
|
||
# copy project files and folders to the current working directory | ||
COPY . . | ||
|
||
# specifies that the container will listen on port 3000 | ||
EXPOSE 3000 | ||
|
||
# specifies the command to run when the Docker image is started | ||
ENTRYPOINT ["./entrypoint.sh"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
# run npm run dev through pm2 | ||
pm2 start npm -- run dev | ||
|
||
# show logs | ||
pm2 logs |