diff --git a/packages/node/Dockerfile b/packages/node/Dockerfile index fe5d3833f4..393ccecbb2 100644 --- a/packages/node/Dockerfile +++ b/packages/node/Dockerfile @@ -1,28 +1,27 @@ -# production images +# Build stage FROM node:18 as builder -ENTRYPOINT ["subql-node"] -RUN npm install -g --force yarn@latest - WORKDIR /app COPY . . -# Install dependencies +RUN npm install -g --force yarn@latest RUN yarn install +# Uncomment the following line if you need to build your application +# RUN yarn build -# Install TypeScript globally -#RUN npm install -g typescript - -# Build the application -#RUN yarn build - +# Production stage FROM node:18-alpine ENV TZ utc RUN apk add --no-cache tini git curl -# Copy the built application from the previous stage -COPY --from=builder /app . -# Adjust the ENTRYPOINT to the location of your application's start script +COPY --from=builder /app/package.json ./ +COPY --from=builder /app/yarn.lock ./ +COPY --from=builder /app/node_modules ./node_modules +# Copy your built files (replace 'dist' with your directory if it's different) +COPY --from=builder /app/dist ./dist +# Copy the bin directory +COPY --from=builder /app/bin ./bin + ENTRYPOINT ["/sbin/tini", "--", "node", "bin/run"] CMD ["-f","/app"] \ No newline at end of file