mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-28 07:50:32 +05:30
Merge branch 'docker'
This commit is contained in:
commit
d7da2bba7e
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
dist
|
||||||
|
node_modules
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM node:5.11
|
||||||
|
|
||||||
|
RUN mkdir -p /usr/src/app
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# Bundle app source
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
CMD ["npm", "start"]
|
@ -30,6 +30,8 @@ var isTest = process.argv.some(function(arg) {
|
|||||||
return arg.indexOf('karma') !== -1;
|
return arg.indexOf('karma') !== -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var isDockerized = !!process.env.DOCKERIZED;
|
||||||
|
|
||||||
process.env.NODE_ENV = isProduction ? 'production' : 'development';
|
process.env.NODE_ENV = isProduction ? 'production' : 'development';
|
||||||
if (isTest) {
|
if (isTest) {
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
@ -220,6 +222,12 @@ var webpackConfig = {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (isDockerized) {
|
||||||
|
webpackConfig.watchOptions = {
|
||||||
|
poll: 2000
|
||||||
|
};
|
||||||
|
webpackConfig.devServer.host = '0.0.0.0';
|
||||||
|
}
|
||||||
|
|
||||||
if (isProduction) {
|
if (isProduction) {
|
||||||
webpackConfig.module.loaders.forEach((loader) => {
|
webpackConfig.module.loaders.forEach((loader) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user