Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit b3f17b9

Browse files
butlerxWardormeur
authored andcommitted
update dockerfile (#258)
* update dockerfile * add testdata service * add host for testdata service * forgotten env var * remove salesforce from network
1 parent 0be781c commit b3f17b9

23 files changed

+183
-146
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
node_modules
3+
.gitignore
4+
*.md
5+
Dockerfile
6+
*.sh
7+
deploy
8+
example
9+
*.yml

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v0.10.38

Dockerfile

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
FROM mhart/alpine-node:0.10
2-
MAINTAINER nearForm <[email protected]>
1+
FROM mhart/alpine-node:0.10.38
2+
MAINTAINER butlerx <[email protected]>
33

4-
RUN apk-install git make gcc g++ python postgresql-client
5-
6-
RUN mkdir -p /usr/src/app /usr/src/app/config /usr/src/app/email-templates /usr/src/app/data /usr/src/app/scripts
4+
RUN apk add --update git build-base python postgresql-client && \
5+
mkdir -p /usr/src/app
76
WORKDIR /usr/src/app
8-
9-
COPY package.json /usr/src/app/
10-
RUN npm install --production && rm -rf /root/.npm
11-
COPY config /usr/src/app/config/
12-
COPY data /usr/src/app/data/
13-
COPY scripts /usr/src/app/scripts/
14-
COPY email-templates /usr/src/app/email-templates/
15-
COPY *.js /usr/src/app/
16-
17-
RUN apk del make gcc g++ python && rm -rf /tmp/* /root/.npm /root/.node-gyp
7+
ADD . /usr/src/app/
8+
RUN npm install && \
9+
rm -rf /root/.npm && \
10+
apk del build-base python && \
11+
rm -rf /tmp/* /root/.npm /root/.node-gyp
12+
EXPOSE 10303
13+
CMD ["node", "service.js"]

config/development.env

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
POSTGRES_HOST=localhost
2+
POSTGRES_NAME=cp-users-development
3+
POSTGRES_USERNAME=platform
4+
POSTGRES_PASSWORD=QdYx3D5y
5+
POSTGRES_PORT=5432
6+
7+
SALESFORCE_ENABLED=false
8+
9+
MAILTRAP_ENABLED=true
10+
MAIL_HOST=mailtrap.io
11+
MAIL_PORT=2525
12+
MAIL_USER=397746d4abc52902b
13+
MAIL_PASS=0383c445ef22d4
14+
15+
HOSTNAME=localhost
16+
17+

network.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22

33
module.exports = function (seneca) {
44
seneca.listen()
5-
.client({type: 'web', port: 10304, pin: {role: 'cd-salesforce', cmd: '*'}})
6-
.client({type: 'web', port: 10301, pin: {role: 'cd-dojos', cmd: '*'}})
7-
.client({type: 'web', port: 10305, pin: {role: 'cd-badges', cmd: '*'}});
5+
.client({
6+
type: 'web',
7+
host: process.env.CD_DOJOS || 'localhost',
8+
port: 10301,
9+
pin: {
10+
role: 'cd-dojos',
11+
cmd: '*'
12+
}
13+
})
14+
.client({
15+
type: 'web',
16+
host: process.env.CD_BADGES || 'localhost',
17+
port: 10305,
18+
pin: {
19+
role: 'cd-badges',
20+
cmd: '*'
21+
}
22+
});
823
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"scripts": {
1010
"test": "npm run lint && bash -c 'source ./config/development.env; ./node_modules/.bin/lab --ignore __core-js_shared__ --flat --threshold 50 -r html -o ./coverage/coverage.html -r lcov -o ./coverage/lcov.info -r json -o ./coverage/coverage.json -r lab-quieter-reporter -o stdout -m 5000'",
11+
"testdata": "node test/lib/service.js",
1112
"covrep": "bash test/covrep.sh",
1213
"lint": "./node_modules/.bin/semistandard *.js config/config.js"
1314
},
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
DO $$
1+
DO $$
22
BEGIN
33
BEGIN
44
ALTER TABLE sys_user ADD COLUMN init_user_type character varying;
55
EXCEPTION
66
WHEN duplicate_column THEN RAISE NOTICE 'column init_user_type already exists in sys_user.';
77
END;
88
END;
9-
$$
9+
$$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
DO $$
1+
DO $$
22
BEGIN
33
BEGIN
44
ALTER TABLE sys_user ADD COLUMN join_requests json[];
55
EXCEPTION
66
WHEN duplicate_column THEN RAISE NOTICE 'column join_requests already exists in sys_user.';
77
END;
88
END;
9-
$$
9+
$$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
DO $$
1+
DO $$
22
BEGIN
33
BEGIN
44
ALTER TABLE cd_profiles ADD COLUMN user_type character varying;
55
EXCEPTION
66
WHEN duplicate_column THEN RAISE NOTICE 'column user_type already exists in cd_profiles.';
77
END;
88
END;
9-
$$
9+
$$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
DO $$
1+
DO $$
22
BEGIN
33
BEGIN
44
ALTER TABLE cd_profiles ADD COLUMN invite_requests json[];
55
EXCEPTION
66
WHEN duplicate_column THEN RAISE NOTICE 'column invite_requests already exists in cd_profiles.';
77
END;
88
END;
9-
$$
9+
$$

0 commit comments

Comments
 (0)