Pyae Phyoe Shein
Pyae Phyoe Shein

Reputation: 13837

how to run bower install inside subfolder in Docker

--myproject
---app
----bower.json
----index.html
---package.json

My project folder structure is like that. What I want is I want to run bower install command in docker file before npm install. Following is my Dockerfile. Got stuck how to go sub folder and run bower install. Thanks.

### STAGE 1: Build ###
FROM node:latest as builder
LABEL auther="PPShein"
COPY package.json package.json
RUN npm install
COPY . .
RUN gulp default

Upvotes: 2

Views: 2144

Answers (1)

Siyu
Siyu

Reputation: 12129

Use

RUN cd app && bower install

Or

WORKDIR app
bower install

this changes the pwd for all following commands, which you may not want.

PS. Careful with COPY . ., it may overwrite what you just built.

Upvotes: 5

Related Questions