Simplify docker configs
This commit is contained in:
+6
-14
@@ -1,17 +1,9 @@
|
||||
FROM node:7
|
||||
ENV IS_DOCKER 1
|
||||
RUN env
|
||||
FROM node
|
||||
|
||||
WORKDIR /app
|
||||
ADD . /app/
|
||||
RUN apt-get update
|
||||
RUN apt-get install nasm
|
||||
RUN npm install webpack -g
|
||||
WORKDIR /tmp
|
||||
COPY package.json /tmp/
|
||||
RUN npm config set registry http://registry.npmjs.org/ && npm install
|
||||
|
||||
WORKDIR /code
|
||||
COPY . /code/
|
||||
RUN cp -a /tmp/node_modules /code/
|
||||
RUN webpack
|
||||
|
||||
EXPOSE 3000
|
||||
RUN npm ci
|
||||
CMD ["npm", "start"]
|
||||
EXPOSE 8080
|
||||
@@ -9,7 +9,7 @@ module.exports = merge(commonConfig, {
|
||||
mode: "development",
|
||||
entry: [
|
||||
"react-hot-loader/patch", // Activate HMR for React
|
||||
"webpack-dev-server/client?http://localhost:8080", // Bundle the client for webpack-dev-server and connect to the provided endpoint
|
||||
"webpack-dev-server/client?http://0.0.0.0:8080", // Bundle the client for webpack-dev-server and connect to the provided endpoint
|
||||
"webpack/hot/only-dev-server", // Bundle the client for hot reloading, only- means to only hot reload for successful updates
|
||||
"./index.tsx" // The entry point of our app
|
||||
],
|
||||
|
||||
+3
-4
@@ -4,8 +4,7 @@ services:
|
||||
web-frontend:
|
||||
build: .
|
||||
image: git.sahkoinsinoorikilta.fi:4567/vtmk/web2.0-frontend
|
||||
# Before you run this file for the first time, make sure
|
||||
# you remove node_modules/ folders in your host machine
|
||||
command: ["bash", "-c", "if test -d node_modules; then echo node_modules_exists; else cp -a /tmp/node_modules /code; fi && cd /code && npm install && npm start"]
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3000:8080"
|
||||
volumes:
|
||||
- ./src:/app/src
|
||||
|
||||
Reference in New Issue
Block a user