From 27a1edd71f3af3b483b2a22e557c5ae6b8670ac3 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Wed, 10 Jul 2024 20:58:53 +0200 Subject: [PATCH] picobello bv --- Dockerfile | 28 ++++++++++++++++++++++++++++ captain-definition | 9 +-------- 2 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5a94c92 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Build stage +FROM node:14 as build-stage + +WORKDIR /app + +# Copy package.json and package-lock.json (if available) +COPY package*.json ./ + +# Install project dependencies +RUN npm install + +# Copy project files and folders to the current working directory (i.e. 'app' folder) +COPY . . + +# Build app for production with minification +RUN npm run build-ntc + +# Production stage +FROM nginx:stable-alpine as production-stage + +# Copy built assets from build-stage +COPY --from=build-stage /app/dist /usr/share/nginx/html + +# Expose port 80 +EXPOSE 80 + +# Start Nginx and keep it running in the foreground +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/captain-definition b/captain-definition index 401b9b3..b4e998e 100644 --- a/captain-definition +++ b/captain-definition @@ -1,11 +1,4 @@ { "schemaVersion": 2, - "dockerfileLines": [ - "FROM node:22.4.1-alpine", - "RUN mkdir -p /usr/src/app", - "WORKDIR /usr/src/app", - "COPY ./ /usr/src/app", - "RUN npm install && npm cache clean --force && npm run build-ntc", - "CMD [ \"npm\", \"start\" ]" - ] + "dockerfilePath" :"./Dockerfile" } \ No newline at end of file