Skip to content

Commit

Permalink
fix: update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
syafiqparadisam committed Jul 19, 2024
1 parent 07be635 commit 07df90c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions project/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Use base image from nodejs alpine
FROM node:20.12-alpine
FROM node:20.12-alpine as build

# Set workdir in docker container
WORKDIR /app

# Copy all file inside docker container
# COPY package*.json .
COPY . .

# Install dependencies
RUN npm install

# RUN npm run build
RUN npm run build

# runs app
CMD npm run dev
# Use a lightweight web server to serve the app
FROM nginx:alpine

# Copy the build output to the Nginx web server directory
COPY --from=build /app/dist /usr/share/nginx/html

# Expose the port on which the app will run
EXPOSE 80

# Start Nginx server
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 07df90c

Please sign in to comment.