Skip to content

Commit 078a160

Browse files
Update Dockerfile
1 parent 8a92b0f commit 078a160

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
FROM node:18
1+
# ---------- Optimised Dockerfile ----------
2+
FROM node:18-slim
23

4+
ARG DEBIAN_FRONTEND=noninteractive
5+
6+
# Install compilers & /usr/bin/time
37
RUN apt-get update && \
4-
apt-get install -y g++ openjdk-17-jdk python3 time
8+
apt-get install -y --no-install-recommends \
9+
g++ openjdk-17-jdk python3 python3-pip time && \
10+
rm -rf /var/lib/apt/lists/*
511

612
WORKDIR /app
13+
14+
COPY package*.json ./
15+
RUN npm ci --omit=dev # reproducible, no devDependencies
16+
717
COPY . .
8-
RUN npm install
918

1019
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
1120
ENV PATH=$JAVA_HOME/bin:$PATH
1221

22+
EXPOSE 8080 # purely informational
1323
CMD ["node", "server.js"]

0 commit comments

Comments
 (0)