Skip to content

Commit 1e4a931

Browse files
committed
Auto merge of #1632 - bryanburgers:add-npm-install, r=jtgeibel
Fix frontend docker configuration in docker-compose Fixes to frontend to make `docker-compose up` work again on a fresh clone. Two fixes need to happen: 1. `npm install` needs to run when building the docker container, so that all of the dependencies exist. 2. A slight change to the `docker-compose.yml` file to properly link up the frontend to the backend. --- *[Edit]: this previously consisted of only a single commit that looked at the frontend.Dockerfile file. As I continued trying to get an environment up, I noticed another fix that needed to be made and decided it was similar-enough in scope that it should be added to his pull request. The original description follows.* **Add `npm install` to frontend Docker** The frontend Docker image appears to be following a pretty standard Node convention of adding the package.json, running `npm install`, and then copying the rest of the application, which makes rebuilding new docker images much faster if there are no dependency changes. However, in the great `yarn` cleanup of 2017, `yarn install` was removed but the corresponding `npm install` was not added back. This means that when the frontend docker image tries to run ember, ember is not available because it was never installed.
2 parents 98cd7bf + 1c044be commit 1e4a931

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ services:
3737
build:
3838
context: .
3939
dockerfile: frontend.Dockerfile
40-
entrypoint: npm run start --proxy http://backend:8888
40+
entrypoint: npm run start -- --proxy http://backend:8888
4141
links:
4242
- backend
4343
ports:

frontend.Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
FROM node:8.6-alpine
22

33
WORKDIR /app
4-
COPY package.json /app
4+
COPY package.json package-lock.json /app/
5+
6+
RUN npm install
57

68
COPY . /app
79

0 commit comments

Comments
 (0)