File tree 3 files changed +19
-32
lines changed
3 files changed +19
-32
lines changed Original file line number Diff line number Diff line change 1
1
.git
2
2
.gitignore
3
+ # Ignore local node_modules because we fetch only production dependencies
4
+ # during the container build.
3
5
node_modules
Original file line number Diff line number Diff line change 1
- FROM node:12.13.1-alpine
1
+ FROM node:12.18-alpine3.12
2
2
3
3
EXPOSE 8061
4
4
5
- COPY . /iframely
6
-
7
5
WORKDIR /iframely
8
6
9
- RUN apk add --no-cache git && \
10
- npm install -g forever && \
11
- npm install
7
+ # Create new non-root user
8
+ RUN addgroup -S iframelygroup && adduser -S iframely -G iframelygroup
9
+
10
+ # This will change the config to `config.<VALUE>.js` and the express server to change its behaviour.
11
+ # You should overwrite this on the CLI with `-e NODE_ENV=production`.
12
+ ENV NODE_ENV=local
13
+
14
+ # # Utilize docker layer cache
15
+ COPY package.json yarn.lock /iframely/
16
+ RUN yarn install --pure-lockfile --production
17
+
18
+ COPY . /iframely
19
+
20
+ USER iframely
12
21
13
22
ENTRYPOINT [ "/iframely/docker/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1
- #! /bin/ash
1
+ #! /bin/sh
2
2
3
- export ARGV=" $@ "
4
- export ARGC=" $# "
5
-
6
- function sigterm_handler() {
7
- echo " SIGTERM signal received."
8
- forever stopall
9
- }
10
-
11
- trap " sigterm_handler; exit" TERM
12
-
13
- function entrypoint() {
14
- if [ " $ARGC " -eq 0 ]
15
- then
16
- # Run server in cluster mode by default
17
- forever start cluster.js
18
- else
19
- # Use command line arguments supplied at runtime
20
- forever start $ARGV
21
- fi
22
-
23
- forever --fifo logs 0 &
24
- wait
25
- }
26
-
27
- entrypoint
3
+ exec node cluster.js
You can’t perform that action at this time.
0 commit comments