Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new commit #77

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions # Unit Test for Dockerfile.dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ dist

# TernJS port file
.tern-port

.codegpt
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const App = () => {
<header className="App-header">
<h1 style={{ marginBottom: "0px" }}>Congratulations!!!</h1>
<p style={{ marginTop: "10px", marginBottom: "50px" }}>
You ran your first container.
Docker champion. You ran your first container.
</p>
<div>
<a
Expand Down