Skip to content

Commit f4207fb

Browse files
refactor(docker): simplify Dockerfile by removing netcat installation
- Removed unnecessary installation of netcat from the Dockerfile for all stages. - Streamlined the build process by eliminating redundant commands, focusing on npm installations. These changes enhance the efficiency of the Dockerfile, reducing build time and complexity.
1 parent 745a049 commit f4207fb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Dockerfile.temporal-worker-main

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
FROM node:20-bullseye AS deps
33
WORKDIR /app/main
44
COPY workers/main/package*.json ./
5-
RUN apt-get update && apt-get install -y netcat && rm -rf /var/lib/apt/lists/* \
6-
&& npm ci --ignore-scripts
5+
RUN npm ci --ignore-scripts
76

87
# Development image
98
FROM node:20-bullseye AS dev
@@ -12,16 +11,14 @@ ENV NODE_ENV=development
1211
ENV DEBUG=*
1312
WORKDIR /app/main
1413
COPY --from=deps /app/main/node_modules ./node_modules
15-
RUN apt-get update && apt-get install -y netcat && rm -rf /var/lib/apt/lists/*
1614
CMD ["npx", "nodemon", "--watch", "./", "--watch", "/app/common", "--ext", "ts", "--exec", "npx", "ts-node", "src/index.ts"]
1715

1816
# Build the app
1917
FROM node:20-bullseye AS build
2018
WORKDIR /app/main
2119
COPY --from=deps /app/main/node_modules ./node_modules
2220
COPY workers/main/ ./
23-
RUN apt-get update && apt-get install -y netcat && rm -rf /var/lib/apt/lists/* \
24-
&& npm run build
21+
RUN npm run build
2522

2623
# Production image
2724
FROM gcr.io/distroless/nodejs20-debian11 AS production

0 commit comments

Comments
 (0)