docker 使用 mongodb 4.4.25

This commit is contained in:
庄建国 2023-10-07 07:36:35 +00:00
parent 4efe7f6fb3
commit 0786aac9a4
4 changed files with 47 additions and 9 deletions

View File

@ -31,6 +31,7 @@ tasks:
command: |
echo "ROOT_URL=$(gp url 6000)" >> .env.local
echo "METADATA_SERVER=$(gp url 6000)" >> .env.local
echo "ROOT_URL=$(gp url 80)" >> deploy/enterprise/.env
yarn docker:db
- name: Steedos
init: |

View File

@ -13,19 +13,51 @@ RUN apt-get update || : && apt-get install -y \
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
# Install MongoDB 5.0
# https://www.mongodb.com/docs/v5.0/tutorial/install-mongodb-on-debian/
RUN apt-get update \
&& apt-get install -y gnupg curl nodejs yarn
RUN curl -fsSL https://pgp.mongodb.com/server-5.0.asc | \
gpg -o /usr/share/keyrings/mongodb-server-5.0.gpg \
--dearmor --no-tty
# Install MongoDB 4.4.25
# https://www.mongodb.com/docs/v4.4/tutorial/install-mongodb-on-ubuntu/
# https://github.com/docker-library/mongo/blob/66197d92be6eafc0a36b2570172de0a5f7a905e1/4.4/Dockerfile
RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
set -- '20691EEC35216C63CAF66CE1656408E390CFB1F5'; \
for key; do \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key"; \
done; \
mkdir -p /etc/apt/keyrings; \
gpg --batch --export "$@" > /etc/apt/keyrings/mongodb.gpg; \
gpgconf --kill all; \
rm -rf "$GNUPGHOME"
RUN echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-5.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list
# Allow build-time overrides (eg. to build image with MongoDB Enterprise version)
# Options for MONGO_PACKAGE: mongodb-org OR mongodb-enterprise
# Options for MONGO_REPO: repo.mongodb.org OR repo.mongodb.com
# Example: docker build --build-arg MONGO_PACKAGE=mongodb-enterprise --build-arg MONGO_REPO=repo.mongodb.com .
ARG MONGO_PACKAGE=mongodb-org
ARG MONGO_REPO=repo.mongodb.org
ENV MONGO_PACKAGE=${MONGO_PACKAGE} MONGO_REPO=${MONGO_REPO}
RUN apt-get update \
&& apt-get install -y mongodb-org=5.0.20 mongodb-org-database=5.0.20 mongodb-org-server=5.0.20 mongodb-org-shell=5.0.20 mongodb-org-mongos=5.0.20 mongodb-org-tools=5.0.20
ENV MONGO_MAJOR 4.4
RUN echo "deb [ signed-by=/etc/apt/keyrings/mongodb.gpg ] http://$MONGO_REPO/apt/ubuntu focal/${MONGO_PACKAGE%-unstable}/$MONGO_MAJOR multiverse" | tee "/etc/apt/sources.list.d/${MONGO_PACKAGE%-unstable}.list"
# https://docs.mongodb.org/master/release-notes/4.4/
ENV MONGO_VERSION 4.4.25
# 09/26/2023, https://github.com/mongodb/mongo/tree/3e18c4c56048ddf22a6872edc111b542521ad1d5
RUN set -x \
# installing "mongodb-enterprise" pulls in "tzdata" which prompts for input
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get install -y \
${MONGO_PACKAGE}=$MONGO_VERSION \
${MONGO_PACKAGE}-server=$MONGO_VERSION \
${MONGO_PACKAGE}-shell=$MONGO_VERSION \
${MONGO_PACKAGE}-mongos=$MONGO_VERSION \
${MONGO_PACKAGE}-tools=$MONGO_VERSION \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/lib/mongodb \
&& mv /etc/mongod.conf /etc/mongod.conf.orig
# Install nginx && redis
RUN apt-get update \

View File

@ -188,4 +188,8 @@ To learn more, please refer to [Supervisor's documentation](http://supervisord.o
## Troubleshooting
If you encounter any errors during this process, please reach out to [**support@steedos.com**](mailto:support@steedos.com) or join our [Discord Server](https://discord.gg/84BFNFQP) and reach out on the #support channel.
If you encounter any errors during this process, please reach out to [**support@steedos.com**](mailto:support@steedos.com) or join our [Discord Server](https://discord.gg/84BFNFQP) and reach out on the #support channel.
## Special Thanks
- [Appsmith](https://github.com/appsmithorg/appsmith)

View File

@ -10,6 +10,7 @@ services:
ports:
- "80:80"
- "443:443"
- "3000:3000"
environment:
- ROOT_URL=http://127.0.0.1:3000
tty: true