website/Dockerfile
mike 2190b10090
All checks were successful
Build and Deploy Docker Image / build (push) Successful in 39s
feat: cloudflare stuff
2024-10-25 07:34:44 -04:00

33 lines
No EOL
672 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 dotechbro_nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/nginx.conf
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]