Skip to content

Fix frontend docker configuration in docker-compose #1632

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

Merged
merged 2 commits into from
Feb 24, 2019

Conversation

bryanburgers
Copy link
Contributor

@bryanburgers bryanburgers commented Feb 22, 2019

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.

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.
When using `npm run start --proxy http://backend:8888`, `npm` interprets
the `--proxy http://backend:8888` as a parameter that IT should parse,
which means the parameter never gets to `ember serve`. Add a `--` in the
middle so that `npm` knows not to parse that flag and instead pass it to
`ember serve`.
@bryanburgers bryanburgers changed the title Add npm install to frontend Docker Fix frontend docker configuration in docker-compose Feb 24, 2019
@jtgeibel
Copy link
Member

Awesome, thanks for the contribution @bryanburgers!

@bors r+

@bors
Copy link
Contributor

bors commented Feb 24, 2019

📌 Commit 1c044be has been approved by jtgeibel

@bors
Copy link
Contributor

bors commented Feb 24, 2019

⌛ Testing commit 1c044be with merge 1e4a931...

bors added a commit that referenced this pull request Feb 24, 2019
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.
@bors
Copy link
Contributor

bors commented Feb 24, 2019

☀️ Test successful - checks-travis
Approved by: jtgeibel
Pushing 1e4a931 to master...

@bors bors merged commit 1c044be into rust-lang:master Feb 24, 2019
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