Skip to content

Commit

Permalink
first draft of render-ws-with-mongodb dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
trautmane committed Jan 29, 2025
1 parent 709a9be commit 6080cbf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 12 additions & 10 deletions render-ws-with-mongo-db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
FROM ubuntu:22.04
LABEL maintainer="Eric Trautman <[email protected]>"

# 1: Install Git, Maven, curl, vim
# 1: Install Git, Maven, curl, vim, gnupg (needed for keyring that Google Cloud SDK install requires)
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y git maven curl vim
apt-get install -y git maven curl vim gnupg

# 1b: Install Google Cloud SDK ( steps from https://stackoverflow.com/a/61420657 )
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update && \
apt-get install google-cloud-sdk
# RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
# curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
# apt-get update && \
# apt-get install -y google-cloud-sdk

# 2. Clone the Repository
WORKDIR /var/www/
Expand All @@ -58,14 +58,16 @@ RUN git checkout newsolver
RUN ./render-ws/src/main/scripts/install.sh && \
cp ./render-ws-with-mongo-db/startup_mongodb_and_jetty.sh .

# 4. Build the Render Modules
# 4. Build only the render-app and render-ws modules and skip tests
RUN { echo 'JAVA_HOME="$(readlink -m ./deploy/*jdk*)"'; } >> ~/.mavenrc && \
mvn --version; mvn --batch-mode -Dproject.build.sourceEncoding=UTF-8 package
mvn --version; mvn --batch-mode --projects ".,render-app,render-ws" -Dproject.build.sourceEncoding=UTF-8 -Dmaven.test.skip package

# 5. Deploy Web Service and remove all unneeded build artifacts
# 5. Deploy Web Service and remove all unneeded source and build artifacts
# leaving only render/deploy and render/startup_mongodb_and_jetty.sh
RUN cp render-ws/target/render-ws-*.war deploy/jetty_base/webapps/render-ws.war && \
rm -rf render/.[dgi]* render/[DLReprt]* render/do*
rm -rf .[dgi]* Dockerfile LICENSE README.md docker-build-and-push.sh docs examples pom.xml \
render-app render-ws render-ws-java-client render-ws-spark-client render-ws-with-mongo-db trakem2-scripts \
/tmp/extract* /root/.m2

# 6. Install MongoDB 6.0.4

Expand Down
8 changes: 3 additions & 5 deletions render-ws-with-mongo-db/startup_mongodb_and_jetty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
echo "starting mongodb"
sudo -u mongodb /usr/bin/mongod -f /etc/mongod.conf &

echo "starting jetty"
deploy/jetty_base/jetty_wrapper.sh start

echo "sleeping 'infinity' to keep container running"
sleep infinity
# note that jetty_wrapper.sh start still does not seem to work and we want to keep the container active anyway
echo "starting jetty_wrapper.sh run (which should keep the container active)"
deploy/jetty_base/jetty_wrapper.sh run

0 comments on commit 6080cbf

Please sign in to comment.