website/Dockerfile
mike 4dd6a09b3f
All checks were successful
Build and Deploy Docker Image / build (push) Successful in 55s
fix: challenges and dockerfile
2024-10-25 03:58:18 -04:00

31 lines
No EOL
623 B
Docker

# Use an official Node.js runtime as a parent image
FROM node:18 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 application
RUN npm run build
# Use an official Nginx image to serve the built application
FROM nginx:alpine
# Copy the built application from the previous stage
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]