diff --git a/# Unit Test for Dockerfile.dockerfile b/# Unit Test for Dockerfile.dockerfile new file mode 100644 index 00000000..09df79bc --- /dev/null +++ b/# Unit Test for Dockerfile.dockerfile @@ -0,0 +1,33 @@ +# Unit Test for Dockerfile +FROM node:18-alpine AS test + +WORKDIR /app + +# Copy the app package and package-lock.json file for testing +COPY package*.json ./ +COPY ./src ./src +COPY ./public ./public + +# Running test cases +RUN npm install \ + && npm run test + +# Clean up after tests +RUN rm -fr node_modules + +# Final stage for the application +FROM node:18-alpine + +WORKDIR /app + +COPY package*.json ./ +COPY ./src ./src +COPY ./public ./public + +RUN npm install \ + && npm install -g serve \ + && npm run build \ + && rm -fr node_modules + +EXPOSE 3000 +CMD [ "serve", "-s", "build" ] \ No newline at end of file diff --git a/.gitignore b/.gitignore index 67045665..39f2e3ef 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,5 @@ dist # TernJS port file .tern-port + +.codegpt \ No newline at end of file diff --git a/src/App.js b/src/App.js index 6dbe5011..34f71207 100644 --- a/src/App.js +++ b/src/App.js @@ -11,7 +11,7 @@ const App = () => {

Congratulations!!!

- You ran your first container. + Docker champion. You ran your first container.