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

Missing script local in frontend when running with Docker #985

Closed
Kratemis opened this issue Feb 29, 2024 · 1 comment · Fixed by #1020
Closed

Missing script local in frontend when running with Docker #985

Kratemis opened this issue Feb 29, 2024 · 1 comment · Fixed by #1020

Comments

@Kratemis
Copy link

Describe the bug
Hello,
In Dockerfile, the last line is "npm run local", but if we check package.json, there is not script called local. I don't know if I miss something because I am not an frontend expert, perhaps I forgive a step.

To Reproduce
Build frontend and execute it

@itxTouseef74
Copy link

itxTouseef74 commented Mar 12, 2024

That issue comes becasue in package.json there is no local there is dev you have to run project by npm run dev. In Docker file you have to make some changes to run this project here is updated Docker file .

Node Version

FROM node:20.9.0-alpine

Set the working directory inside the container

WORKDIR /usr/src/app

Copy package.json and package-lock.json to the working directory

COPY package*.json ./

Install dependencies

RUN npm install

Copy the application files to the working directory

COPY . .

Build the application

RUN npm run build

Expose the port that your application runs on

EXPOSE 3000

Start the application when the container starts

CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]

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 a pull request may close this issue.

2 participants