Home > Net >  Dockerfile http-server options
Dockerfile http-server options

Time:10-22

I'm running Vue in a docker container. In my Dockerfile, I'm trying to run the command:

http-server dist --proxy http://localhost:8080?"

Here's my Dockerfile:

FROM node:lts-alpine

RUN npm install -g http-server

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

EXPOSE 8080
CMD [ "http-server",  "dist", "--proxy http://localhost:8080?"]

I have tried placing "--proxy http://localhost:8080?" everywhere in the CMD array.

"http-server --proxy http://localhost:8080?"

results in an error.

Any direction on how to get the --proxy option to run?

Thanks,

CodePudding user response:

It's probably expecting --proxy http://localhost:8080 to be two separate parameters. It's what Bash does when parsing the same command.

CMD [ "http-server",  "dist", "--proxy", "http://localhost:8080?"]
  • Related