Skip to content

Commit

Permalink
Dockerfile for FE
Browse files Browse the repository at this point in the history
  • Loading branch information
AidenLYT committed Sep 19, 2024
1 parent 3b10035 commit 77c883a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions peer-prep-fe/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
.git
29 changes: 29 additions & 0 deletions peer-prep-fe/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Stage 1: Build the Angular application
FROM node:latest AS build

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the Angular application
RUN npm run build

# Stage 2: Serve the Angular application with a lightweight web server
FROM nginx:latest

# Copy the build output from the previous stage
COPY --from=build /app/dist/peer-prep-fe /usr/share/nginx/html

# Expose port 80
EXPOSE 80

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

0 comments on commit 77c883a

Please sign in to comment.