Skip to content

Commit

Permalink
docker: upgrade to node 10
Browse files Browse the repository at this point in the history
This also addresses minor dependency issues with package.json.
  • Loading branch information
jzelinskie committed Jan 21, 2019
1 parent 11fc0ba commit 3ade6f2
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 16 deletions.
22 changes: 14 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
FROM centos:7

ENV APP_ROOT /qontract-server

# Set PATH, because "scl enable" does not have any effects to "docker build"
ENV PATH $PATH:/opt/rh/rh-nodejs8/root/usr/bin
ENV PATH /opt/rh/rh-nodejs10/root/usr/bin:$PATH

# enable scl with nodejs8
RUN yum install centos-release-scl-rh rh-nodejs8 -y && \
yum install rh-nodejs8 -y && \
yum clean all
RUN yum install centos-release-scl-rh -y && \
yum install rh-nodejs10 rh-nodejs10-npm -y && \
yum clean all && \
npm install -g yarn

ENV APP_ROOT /opt/qontract-server
ADD . ${APP_ROOT}
WORKDIR ${APP_ROOT}

RUN npm install
RUN adduser qontract
RUN chown -R qontract /opt/qontract-server
USER qontract

ENV PATH /opt/rh/rh-nodejs10/root/usr/bin:$PATH

RUN yarn install

EXPOSE 4000
CMD ["npm", "start"]
CMD ["yarn", "run", "server"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ yarn run dev
To run an instance of the qontract GraphQL console:

```sh
DATAFILES_FILE=your_test_datafile yarn run server
LOAD_METHOD=fs DATAFILES_FILE=your_test_datafile yarn run server
```
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
{
"name": "qontract-server",
"version": "1.0.0",
"description": "",
"main": "server.js",
"description": "qontract graphql server",
"author": "Red Hat App SREs <[email protected]>",
"license": "Apache-2.0",
"engines": {
"node": ">=10.10"
},
"scripts": {
"dev": "rm -rf ./dist && ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode development --watch --progress",,
"watch": "rm -rf ./dist && ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode development --watch --progress",
"build": "rm -rf ./dist && NODE_ENV=production ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode=production",
"server": "LOAD_METHOD=fs node dist/main-bundle.js schemas",
"server": "node dist/main-bundle.js schemas",
"test": "mocha --recursive"
},
"author": "Red Hat App SREs <[email protected]>",
"license": "Apache-2.0",
"dependencies": {
"apollo-server-express": "^2.2.0",
"aws-sdk": "^2.364.0",
"bufferutil": "^4.0.1",
"dotenv": "^6.1.0",
"express": "^4.16.4",
"fs": "0.0.1-security",
"graphql": "^14.0.2",
"jsonpointer": "^4.0.1",
"node-forge": "^0.7.6",
"path": "^0.12.7"
"path": "^0.12.7",
"utf-8-validate": "^5.0.2"
},
"devDependencies": {
"@types/webpack": "^4.4.22",
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,13 @@ [email protected], buffer@^4.3.0:
ieee754 "^1.1.4"
isarray "^1.0.0"

bufferutil@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.1.tgz#3a177e8e5819a1243fe16b63a199951a7ad8d4a7"
integrity sha512-xowrxvpxojqkagPcWRQVXZl0YXhRhAtBEIq3VoER1NH5Mw1n1o0ojdspp+GS2J//2gCVyrzQDApQ4unGF+QOoA==
dependencies:
node-gyp-build "~3.7.0"

builtin-modules@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
Expand Down Expand Up @@ -2605,6 +2612,11 @@ node-forge@^0.7.6:
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.6.tgz#fdf3b418aee1f94f0ef642cd63486c77ca9724ac"
integrity sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==

node-gyp-build@~3.7.0:
version "3.7.0"
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.7.0.tgz#daa77a4f547b9aed3e2aac779eaf151afd60ec8d"
integrity sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w==

node-libs-browser@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df"
Expand Down Expand Up @@ -3823,6 +3835,13 @@ use@^3.1.0:
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==

utf-8-validate@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.2.tgz#63cfbccd85dc1f2b66cf7a1d0eebc08ed056bfb3"
integrity sha512-SwV++i2gTD5qh2XqaPzBnNX88N6HdyhQrNNRykvcS0QKvItV9u3vPEJr+X5Hhfb1JC0r0e1alL0iB09rY8+nmw==
dependencies:
node-gyp-build "~3.7.0"

util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
Expand Down

0 comments on commit 3ade6f2

Please sign in to comment.