Skip to content

Commit 425728d

Browse files
committed
Use JSON (exec) form in Dockerfile
1 parent 4aef28f commit 425728d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ ENV NODE_ENV=production
55

66
# Add and set non-root user. Disable the password and do not create a home folder.
77

8-
RUN adduser -D ackee ackee
8+
RUN [ "adduser", "-D", "ackee", "ackee" ]
99
USER ackee
1010

1111
WORKDIR /srv/app/
1212

1313
# Add dependencies first so that Docker can use the cache as long as the dependencies stay unchanged
1414

1515
COPY package.json package-lock.json /srv/app/
16-
RUN npm ci
16+
RUN [ "npm", "ci" ]
1717

1818
# Copy source after the dependency step as it's more likely that the source changes
1919

@@ -33,7 +33,8 @@ COPY --from=build /srv/app/ /srv/app/
3333

3434
# Create user/group to run as, change ownership of files and set user
3535

36-
RUN adduser -D ackee ackee && chown -R ackee:ackee /srv/app
36+
RUN [ "adduser", "-D", "ackee", "ackee" ]
37+
RUN [ "chown", "-R", "ackee:ackee", "/srv/app" ]
3738
USER ackee
3839

3940
# Run healthcheck against MongoDB, server and API.

0 commit comments

Comments
 (0)