-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'AliroGPT' of https://github.com/jay-m-dev/AliroGPT into…
… AliroGPT
- Loading branch information
Showing
5 changed files
with
103 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
FROM mongo:4.4.18 | ||
# Stage 1: Build stage with all necessary files | ||
FROM mongo:4.4.18 AS builder | ||
|
||
WORKDIR /opt/ | ||
|
||
ARG docker_filepath=docker/dbmongo/files | ||
|
||
RUN apt-get update && apt-get install -y dos2unix | ||
|
||
# RUN apt-get update | ||
# RUN apt-get install gpg wget | ||
# RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null | ||
# RUN apt-get update | ||
|
||
|
||
#add repo for mongodb | ||
# RUN echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list | ||
# RUN apt-get update --fix-missing && \ | ||
# apt-get install -y --allow-unauthenticated \ | ||
# vim mongodb-org npm openssh-client htop dos2unix \ | ||
# net-tools iputils-ping \ | ||
# --no-install-recommends && \ | ||
# apt-get clean && \ | ||
# rm -rf /var/lib/apt/lists/* | ||
|
||
#check if we need to rebuild | ||
# Copy necessary files | ||
COPY ${docker_filepath}/mongod.conf /etc/ | ||
COPY ${docker_filepath}/users.json /root/ | ||
COPY ${docker_filepath}/projects.json /root/ | ||
COPY ${docker_filepath}/entrypoint.sh /root/ | ||
COPY ${docker_filepath}/sync.sh /root/ | ||
RUN dos2unix /root/entrypoint.sh /root/sync.sh | ||
RUN dos2unix /root/users.json /root/projects.json | ||
RUN dos2unix /etc/mongod.conf | ||
RUN apt-get remove -y dos2unix && apt-get clean | ||
|
||
# Convert line endings for DOS/Windows compatibility | ||
RUN apt-get update && apt-get install -y dos2unix && \ | ||
dos2unix /root/entrypoint.sh /root/sync.sh /root/users.json /root/projects.json && \ | ||
dos2unix /etc/mongod.conf && \ | ||
apt-get remove -y dos2unix && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean | ||
|
||
# Stage 2: Final runtime image | ||
FROM mongo:4.4.18 | ||
|
||
# Copy required configurations and scripts from the builder stage | ||
COPY --from=builder /etc/mongod.conf /etc/ | ||
COPY --from=builder /root/entrypoint.sh /root/ | ||
COPY --from=builder /root/sync.sh /root/ | ||
COPY --from=builder /root/users.json /root/ | ||
COPY --from=builder /root/projects.json /root/ | ||
|
||
EXPOSE 27017 | ||
|
||
CMD ["/bin/bash", "/root/entrypoint.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters