Skip to content

Commit 420ffeb

Browse files
authored
Merge pull request #1521 from finos/dockerfile-optimizations
fix: refactor Dockerfile to speed up run times
2 parents fc23d58 + 7327c0e commit 420ffeb

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,24 @@ RUN npm run build-ui \
1919

2020
FROM node:24@sha256:5a593d74b632d1c6f816457477b6819760e13624455d587eef0fa418c8d0777b AS production
2121

22-
COPY --from=builder /out/package*.json ./
23-
COPY --from=builder /out/node_modules/ /app/node_modules/
24-
COPY --from=builder /out/dist/ /app/dist/
25-
COPY --from=builder /out/build /app/dist/build/
26-
COPY proxy.config.json config.schema.json ./
27-
COPY docker-entrypoint.sh /docker-entrypoint.sh
28-
29-
USER root
22+
WORKDIR /app
3023

31-
RUN apt-get update && apt-get install -y \
32-
git tini \
33-
&& rm -rf /var/lib/apt/lists/*
24+
# Install deps and create data dirs once
25+
RUN apt-get update && apt-get install -y --no-install-recommends git tini \
26+
&& rm -rf /var/lib/apt/lists/* \
27+
&& mkdir -p /app/.data /app/.tmp /app/.remote \
28+
&& chown 1000:1000 /app /app/.data /app/.tmp /app/.remote
29+
30+
COPY --chown=1000:1000 --from=builder /out/package*.json ./
31+
COPY --chown=1000:1000 --from=builder /out/node_modules/ ./node_modules/
32+
COPY --chown=1000:1000 --from=builder /out/dist/ ./dist/
33+
COPY --chown=1000:1000 --from=builder /out/build ./dist/build/
34+
COPY --chown=1000:1000 proxy.config.json config.schema.json ./
35+
COPY docker-entrypoint.sh /docker-entrypoint.sh
3436

35-
RUN mkdir -p /app/.data /app/.tmp /app/.remote \
36-
&& chown -R 1000:1000 /app
3737

3838
USER 1000
3939

40-
WORKDIR /app
41-
4240
EXPOSE 8080 8000 8444
4341

4442
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]

0 commit comments

Comments
 (0)