From 95d28a0b99e61d945e5ff29ff221e9b18e704799 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Wed, 10 Jul 2024 21:20:24 +0200 Subject: [PATCH] idk --- Dockerfile | 30 ------------------------------ captain-definition | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index d8c5929..0000000 --- a/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -# Build stage -FROM node:14 as build-stage - -RUN mkdir -p /usr/src/app - -WORKDIR /usr/src/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 . /usr/src/app - -# 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 /usr/src/app/dist /var/www/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 b4e998e..38316ce 100644 --- a/captain-definition +++ b/captain-definition @@ -1,4 +1,15 @@ { - "schemaVersion": 2, - "dockerfilePath" :"./Dockerfile" + "schemaVersion": 2, + "dockerfileLines": [ + "FROM node:22.4.1-alpine as builder", + "RUN mkdir -p /usr/src/app", + "WORKDIR /usr/src/app", + "COPY ./ /usr/src/app", + "RUN npm install && npm run build-ntc", + + "FROM nginx:alpine", + "COPY --from=builder /usr/src/app/dist /usr/share/nginx/html", + "EXPOSE 80", + "CMD [\"nginx\", \"-g\", \"daemon off;\"]" + ] } \ No newline at end of file