From cb83fbd5362dbff7d31b76b182eaedf304b91c15 Mon Sep 17 00:00:00 2001 From: Smyja Date: Tue, 28 Nov 2023 17:41:09 +0100 Subject: [PATCH] added dockerfile and updated captain file --- Dockerfile | 21 +++++++++++++++++++++ captain-definition-frontend | 14 ++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fd4d9f8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:16-alpine + +# Set working directory + +ENV NODE_ENV=production +# Copy package.json and package-lock.json (if available) +COPY package*.json ./ + + +# Copy the built application files + + +COPY ./public ./public + +COPY ./node_modules ./node_modules +# Expose the desired port (e.g., 3000) + +EXPOSE 3000 + +# Start the Node.js server +CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/captain-definition-frontend b/captain-definition-frontend index 8da8a15..d0c5f6c 100644 --- a/captain-definition-frontend +++ b/captain-definition-frontend @@ -1,10 +1,4 @@ - { - "schemaVersion": 2, - "dockerfileLines": [ - "FROM node:16-alpine", - "WORKDIR /usr/app", - "COPY . /usr/src/app", - "RUN npm install", - "CMD [ \"npm\", \"start\" ]" - ] - } \ No newline at end of file +{ + "schemaVersion": 2, + "dockerfilePath": "./Dockerfile" +} \ No newline at end of file