Skip to content

Commit 35ac92e

Browse files
authored
Merge pull request #1425 from outoftime/docker-improvements
Docker environment improvements
2 parents f24d26f + dfe8185 commit 35ac92e

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
FROM node:8.10
22

3+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
4+
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
5+
RUN apt-get update && apt-get install -y google-chrome-stable
6+
37
RUN echo '{"allow_root": true}' > /root/.bowerrc
48

59
WORKDIR /app
6-
ADD . /app
10+
11+
COPY package.json yarn.lock bower.json ./
12+
13+
RUN yarn --frozen-lockfile
14+
15+
COPY . /app
716

817
EXPOSE 3000

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ services:
1010
- node_modules:/app/node_modules
1111
- npm_cache:/root/.npm
1212
- yarn_cache:/usr/local/share/.cache/yarn
13+
tmpfs:
14+
- /app/dist
1315
volumes:
1416
node_modules:
1517
npm_cache:

karma.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* eslint-disable import/unambiguous */
33
/* eslint-disable import/no-commonjs */
44

5+
const isDocker = require('is-docker');
56
const webpackConfiguration = require('./webpack.config.js');
67

78
const isCi = Boolean(process.env.TRAVIS);
@@ -76,7 +77,7 @@ module.exports = function(config) {
7677

7778
reporters: ['dots', 'BrowserStack'],
7879
});
79-
} else if (isCi) {
80+
} else if (isCi || isDocker()) {
8081
config.set({
8182
browsers: ['ChromeHeadlessNoSandbox'],
8283
customLaunchers: {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"immutable-devtools": "0.1.3",
269269
"imports-loader": "^0.8.0",
270270
"inline-chunk-manifest-html-webpack-plugin": "^2.0.0",
271+
"is-docker": "^1.1.0",
271272
"json-loader": "^0.5.4",
272273
"karma": "^2.0.0",
273274
"karma-browserstack-launcher": "^1.1.1",

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5438,6 +5438,10 @@ is-directory@^0.3.1:
54385438
version "0.3.1"
54395439
resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1"
54405440

5441+
is-docker@^1.1.0:
5442+
version "1.1.0"
5443+
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-1.1.0.tgz#f04374d4eee5310e9a8e113bf1495411e46176a1"
5444+
54415445
is-dotfile@^1.0.0:
54425446
version "1.0.3"
54435447
resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1"

0 commit comments

Comments
 (0)