Skip to content

Commit

Permalink
Mutli-stage docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
binoculars committed Nov 1, 2017
1 parent 901e5a9 commit 199f4db
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .ember-cli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"port": 4400,
"port": 4200,
"live-reload-port": 41954
}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Update README
- Use .nvmrc file (for travis and local)
- Update yarn.lock
- Update Dockerfile
- Use COS ember-base image and multi-stage build
- Notify DevOps prior to merging into master to update Jenkins
### Removed
### Fixed
- Fix Loading indicator on Reviews dashboard which was not displaying when user clicks on see more link button.
Expand Down
59 changes: 17 additions & 42 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,46 +1,8 @@
FROM node:8

RUN apt-get update \
&& apt-get install -y \
git \
# Next 2 needed for yarn
apt-transport-https \
ca-certificates \
# watchman
build-essential \
automake \
autoconf \
python-dev \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y \
yarn \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*

ENV WATCHMAN_VERSION 4.9.0
RUN cd /tmp \
&& git clone https://github.com/facebook/watchman.git \
&& cd watchman \
&& git checkout v$WATCHMAN_VERSION \
&& ./autogen.sh \
&& ./configure --enable-statedir=/tmp \
&& make \
&& make install \
&& mv watchman /usr/local/bin/watchman \
&& rm -Rf /tmp/watchman
### App code
FROM quay.io/centerforopenscience/ember-base AS app

RUN mkdir -p /code
WORKDIR /code

COPY ./package.json ./yarn.lock /code/
RUN yarn --frozen-lockfile --ignore-engines
COPY ./package.json ./yarn.lock ./.yarnrc ./
RUN yarn --frozen-lockfile

COPY ./ ./

Expand All @@ -49,4 +11,17 @@ ENV GIT_COMMIT ${GIT_COMMIT}

RUN yarn build --environment=production

### Dist
FROM node:8-alpine AS dist

RUN mkdir -p /code
WORKDIR /code

COPY --from=app /code/dist /code/dist

### Dev
FROM app AS dev

EXPOSE 4200

CMD ["yarn", "start"]
11 changes: 0 additions & 11 deletions Dockerfile-alpine

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You will need the following software properly installed on your computer.
## Running / Development

* `ember serve`
* Visit your app at [http://localhost:4400](http://localhost:4400).
* Visit your app at [http://localhost:4200](http://localhost:4200).

### Code Generators

Expand Down

0 comments on commit 199f4db

Please sign in to comment.