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

Update Dockerfile #49

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Update Dockerfile #49

wants to merge 10 commits into from

Conversation

xiaotimtim
Copy link

No description provided.

@xiaotimtim
Copy link
Author

1

@xiaotimtim xiaotimtim closed this Jul 3, 2024
@xiaotimtim xiaotimtim reopened this Jul 3, 2024
@xiaotimtim
Copy link
Author

1

@LarissaSilvaFernandes LarissaSilvaFernandes mentioned this pull request Jul 3, 2024
1 task
@Hellal1997
Copy link

Stage 1: Build the React application

FROM node:8.15.1-alpine as build-stage

Set the working directory in the container

WORKDIR /usr/src/app

Copy package.json and package-lock.json

COPY package*.json ./

Install dependencies

RUN npm --verbose install

Copy the rest of the application code

COPY . .

Build the React application

RUN npm run build
RUN npm install --force

Stage 2: Serve the React application using a lightweight web server

FROM nginx:alpine

Copy the build artifacts from the build stage

#COPY --from=build /app/build /usr/share/nginx/index.html

Expose port 80 to access the application

EXPOSE 80

Start Nginx

CMD ["nginx", "-g", "daemon off;"]

@Hellal1997
Copy link

you can use it

Copy link

@Hellal1997 Hellal1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can change such as i say to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants