mongodb.dockerfile 732 B

1234567891011121314151617181920
  1. FROM buildpack-deps:jammy
  2. ARG MONGODB_VERSION=6.0
  3. COPY ./ ./
  4. ARG DEBIAN_FRONTEND=noninteractive
  5. RUN wget -qO - https://www.mongodb.org/static/pgp/server-${MONGODB_VERSION}.asc > /etc/apt/keyrings/mongodb-org.asc
  6. RUN echo "deb [ signed-by=/etc/apt/keyrings/mongodb-org.asc ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/${MONGODB_VERSION} multiverse" > \
  7. /etc/apt/sources.list.d/mongodb-org.list
  8. # Complete and utter hax if works
  9. RUN ln -s /bin/echo /bin/systemctl
  10. RUN apt-get -yqq update && apt-get -yqq install mongodb-org
  11. RUN mkdir -p /data/db
  12. RUN chmod 777 /data/db
  13. RUN mongod --fork --logpath /var/log/mongodb.log --bind_ip_all && sleep 10 && mongosh < create.js && sleep 10
  14. CMD ["mongod", "--bind_ip_all"]