Hello team. I try to run the .sh file when mongodb-atlas-local Docker starts. I was using docker-entrypoint-initdb.d, but it’s not working. I have some checks, and I think mongodb-atlas-local not support it. I hope someone knows about this topic.
This my Docker file:
FROM mongo:7.0.11 AS backup
ARG ATLAS_CONNECTION_STRING
WORKDIR /workspace
COPY --chmod=777 ./backup_data.sh /workspace/
RUN /workspace/backup_data.sh
FROM mongo:7.0.11 as tools
FROM mongodb/mongodb-atlas-local
COPY --from=tools /usr/bin/mongorestore /usr/bin/
COPY --from=tools /usr/lib/ /usr/lib/
RUN mongorestore --version
COPY --chmod=777 ./restore_data.sh /docker-entrypoint-initdb.d/1_restore_data.sh
COPY --from=backup /workspace/backups /backups
ARG IMAGE_DESCRIPTION
LABEL org.opencontainers.image.description=${IMAGE_DESCRIPTION}