diff --git a/Dockerfile b/Dockerfile index 9347805d..e8090159 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,24 +6,25 @@ WORKDIR /src ENV NODE_ENV="production" -# Copy package.json and .env dependencies +# Install necessary system packages first +RUN apk add --no-cache bash vim + +# Copy package.json and package-lock.json COPY package*.json ./ -RUN npm ci --only=production --silent + +# Install dependencies +RUN npm ci --only=production --silent && \ + npm cache clean --force # Rename config.template.js to config.js COPY ./app/src/config.template.js ./app/src/config.js -# Install necessary system packages and dependencies -RUN apk add --no-cache \ - bash \ - vim \ - && npm install \ - && npm cache clean --force \ - && rm -rf /tmp/* /var/tmp/* /usr/share/doc/* - # Copy the application code COPY app app COPY public public +# Clean up temporary files +RUN rm -rf /tmp/* /var/tmp/* /usr/share/doc/* + # Set default command to start the application CMD ["npm", "start"] \ No newline at end of file