Peter Southwell
I kinda do it like this… Using Dockerfile in the same directory as my node.
------------------ Dockerfile ------------
# Use Node v8 as the base image.
FROM node:latest
#COPY [–chown=root:root] . .
COPY . .
RUN npm install
RUN npm run build
CMD [“npm”, “start”]
-------------- End
This works really great to me… Super super simple… We use .env file for config bits.
Our app is an NPM app using react.
=========================
Package.json
{
“name”: “ilm-client”,
“version”: “0.1.0”,
“private”: true,
“dependencies”: {
“axios”: “^0.19.0”,
“flux”: “^3.1.3”,
“mdbreact”: “4.10.0”,
“moment”: “^2.23.0”,
“query-string”: “^6.8.1”,
“react”: “^16.8.6”,
“react-bootstrap”: “^0.32.4”,
“react-dom”: “^16.8.6”,
“react-google-login”: “^5.0.4”,
“react-loader-spinner”: “^2.3.0”,
“react-redux”: “^5.0.7”,
“react-router-dom”: “^4.3.1”,
“react-scripts”: “^2.1.8”,
“react-select”: “^2.4.4”,
“react-table”: “^6.10.0”,
“react-toastify”: “^5.3.1”,
“redux”: “^3.5.2”,
“redux-devtools-extension”: “^2.13.7”,
“redux-logger”: “^3.0.6”,
“redux-thunk”: “^2.1.0”
},
“scripts”: {
“start”: “react-scripts start”,
“compile”: “react-scripts build”,
“build”: “react-scripts build”,
“test”: “react-scripts test --env=jsdom”,
“eject”: “react-scripts eject”
},
“browserslist”: [
“>0.2%”,
“not ie <= 11”,
“not op_mini all”
]
}
Also in the same directory as the docker file.
So by hand… Ill just check out the project… Run the docker. but… it should at least show how easy it is to get going on a vanila linux.
Hope that helps and isn’t TOOOOO obvious.
For us… we use this for GCLOUD. It deploys to a template (the dockerfile) builds it… And runs it under load balance. Works really nice.