From cf8b688b017851dd5fda9d30e341cabfd4d9d4c7 Mon Sep 17 00:00:00 2001 From: Bubbles The Dev <152947339+KernFerm@users.noreply.github.com> Date: Sun, 24 Nov 2024 04:54:31 -0500 Subject: [PATCH] Update Dockerfile Signed-off-by: Bubbles The Dev <152947339+KernFerm@users.noreply.github.com> --- Dockerfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1d79538..f59c54f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,20 @@ # Use the official Node.js LTS image based on Alpine FROM node:lts-alpine -# Update apk and explicitly install OpenSSL -RUN apk update && apk add --no-cache openssl +# Set environment variables for production +ENV NODE_ENV=production + +# Update apk and explicitly install OpenSSL and other necessary dependencies +RUN apk update && apk add --no-cache openssl bash # Set working directory inside the container WORKDIR /app -# Copy package.json and package-lock.json and install dependencies +# Copy package.json and package-lock.json first to leverage Docker cache COPY package.json package-lock.json ./ -RUN npm install --production + +# Install dependencies securely +RUN npm ci --only=production # Copy the rest of the application files COPY . .