Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added gitpod config file to setup mongodb and tools #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .gitpod.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM gitpod/workspace-base

USER gitpod

# Dazzle does not rebuild a layer until one of its lines are changed. Increase this counter to rebuild this layer.
ENV TRIGGER_REBUILD=1

# Install MongoDB
# Source: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu-tarball/#install-mongodb-community-edition
RUN mkdir -p /tmp/mongodb && \
cd /tmp/mongodb && \
wget -qOmongodb.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.8.tgz && \
tar xf mongodb.tgz && \
cd mongodb-* && \
sudo cp bin/* /usr/local/bin/ && \
rm -rf /tmp/mongodb && \
sudo mkdir -p /data/db && \
sudo chown gitpod:gitpod -R /data/db

# Install tools
RUN sudo apt-get install gnupg && \
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
RUN echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | \
sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list

RUN sudo apt-get update && sudo apt-get install -y mongodb-mongosh

RUN mkdir -p /tmp/mongodb-tools && \
cd /tmp/mongodb-tools && \
wget -qOtools.tgz https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2004-x86_64-100.5.2.tgz && \
tar xf tools.tgz && \
cd mongodb-* && \
sudo cp bin/* /usr/local/bin/ && \
rm -rf /tmp/mongodb-tools
5 changes: 5 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
image:
file: .gitpod.dockerfile

tasks:
- command: mkdir -p /workspace/data && mongod --dbpath /workspace/data