FROM node:20-bookworm-slim
LABEL maintainer="ferronrsmith@gmail.com"
ENV NODE_ENV=production
WORKDIR /app

COPY . .

RUN npm install --production --legacy-peer-deps

# Overwrite the entrypoint script used in the base image
COPY docker-entrypoint.sh /usr/local/bin/

# This is already set in the base image
# ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

# This will get `elasticump` and `multielasticdump` in the PATH
RUN npm link

CMD ["elasticdump"]