Skip to content

Commit 2de99a2

Browse files
fix: change owner of application files, run as non-root user, linting
1 parent fccbcb1 commit 2de99a2

File tree

8 files changed

+27
-10
lines changed

8 files changed

+27
-10
lines changed

meteor/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,6 @@ COPY meteor/docker-entrypoint.sh /opt
6767
ENV WORKER_EXEC_DIR=/opt/packages/job-worker
6868

6969
WORKDIR /opt/core/
70+
RUN chown -R 1000:1000 /opt/core
71+
USER 1000
7072
CMD ["/opt/docker-entrypoint.sh"]

meteor/Dockerfile.circle

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,27 @@ ENV NODE_URL="https://static.meteor.com/dev-bundle-node-os/unofficial-builds/v${
66
ENV DIR_NODE=/usr/local
77

88
RUN apk add --no-cache \
9-
libstdc++ \
10-
&& apk add --no-cache --virtual .build-deps-full \
11-
binutils-gold \
12-
curl \
13-
gnupg \
14-
xz
9+
libstdc++ \
10+
&& apk add --no-cache --virtual .build-deps-full \
11+
binutils-gold \
12+
curl \
13+
gnupg \
14+
xz
1515

16+
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
1617
RUN echo $NODE_URL \
17-
&& curl -sSL "$NODE_URL" | tar -xz -C /usr/local/ && mv $DIR_NODE/node-v${NODE_VERSION}-linux-x64 $DIR_NODE/v$NODE_VERSION
18+
&& curl -sSL "$NODE_URL" | tar -xz -C /usr/local/ && mv $DIR_NODE/node-v${NODE_VERSION}-linux-x64 $DIR_NODE/v$NODE_VERSION
1819

1920
# add node and npm to path so the commands are available
20-
ENV NODE_PATH $DIR_NODE/v$NODE_VERSION/lib/node_modules
21-
ENV PATH $DIR_NODE/v$NODE_VERSION/bin:$PATH
21+
ENV NODE_PATH=$DIR_NODE/v$NODE_VERSION/lib/node_modules
22+
ENV PATH=$DIR_NODE/v$NODE_VERSION/bin:$PATH
2223

2324
# confirm installation
2425
RUN node -v && npm -v
2526

2627
COPY meteor/bundle /opt/core
2728
COPY meteor/docker-entrypoint.sh /opt
28-
WORKDIR /opt/core/
29+
WORKDIR /opt/core
30+
RUN chown -R 1000:1000 /opt/core
31+
USER 1000
2932
CMD ["/opt/docker-entrypoint.sh"]

packages/live-status-gateway/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ COPY --from=0 /opt/shared-lib /opt/shared-lib
2727
COPY --from=0 /opt/corelib /opt/corelib
2828

2929
WORKDIR /opt/live-status-gateway
30+
RUN chown -R 1000:1000 /opt/live-status-gateway
31+
USER 1000
3032
CMD ["node", "dist/index.js"]

packages/live-status-gateway/Dockerfile.circle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ COPY shared-lib /opt/shared-lib
1010
COPY corelib /opt/corelib
1111

1212
WORKDIR /opt/live-status-gateway
13+
RUN chown -R 1000:1000 /opt/live-status-gateway
14+
USER 1000
1315
CMD ["node", "dist/index.js"]

packages/mos-gateway/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ COPY --from=0 /opt/server-core-integration /opt/server-core-integration
2323
COPY --from=0 /opt/shared-lib /opt/shared-lib
2424

2525
WORKDIR /opt/mos-gateway
26+
RUN chown -R 1000:1000 /opt/mos-gateway
27+
USER 1000
2628
CMD ["node", "dist/index.js"]

packages/mos-gateway/Dockerfile.circle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ COPY server-core-integration /opt/server-core-integration
88
COPY shared-lib /opt/shared-lib
99

1010
WORKDIR /opt/mos-gateway
11+
RUN chown -R 1000:1000 /opt/mos-gateway
12+
USER 1000
1113
CMD ["node", "dist/index.js"]

packages/playout-gateway/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ COPY --from=0 /opt/server-core-integration /opt/server-core-integration
2323
COPY --from=0 /opt/shared-lib /opt/shared-lib
2424

2525
WORKDIR /opt/playout-gateway
26+
RUN chown -R 1000:1000 /opt/playout-gateway
27+
USER 1000
2628
CMD ["node", "dist/index.js"]

packages/playout-gateway/Dockerfile.circle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ COPY server-core-integration /opt/server-core-integration
88
COPY shared-lib /opt/shared-lib
99

1010
WORKDIR /opt/playout-gateway
11+
RUN chown -R 1000:1000 /opt/playout-gateway
12+
USER 1000
1113
CMD ["node", "dist/index.js"]

0 commit comments

Comments
 (0)