Refactor Dockerfile for improved build process; switch to node:20 base image, add build step, and configure volume and port exposure. Update package dependencies for bcrypt and bcryptjs, remove unused files, and enhance README with clearer project structure and setup instructions.
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -1,4 +1,4 @@
|
||||
FROM node:20-alpine
|
||||
FROM node:20
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -8,4 +8,16 @@ RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["npm", "start"]
|
||||
RUN npm run build
|
||||
|
||||
VOLUME ["/app/docker"]
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "start"]
|
||||
|
||||
# Building Instructions
|
||||
#
|
||||
# docker build -t markdownblog .
|
||||
# docker run -p 8080:3000 -v markdownblog-posts:/app/docker markdownblog
|
||||
# docker container prune
|
||||
Reference in New Issue
Block a user