Skip to content

Commit

Permalink
feat : updated Dockerfile-12
Browse files Browse the repository at this point in the history
  • Loading branch information
surjendu104 committed Feb 13, 2024
1 parent face204 commit d855f8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get update && \

EXPOSE 27017 8080
ADD target/url-shortener-images.jar url-shortener-images.jar
RUN apt-get update && apt-get install -y supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

COPY start.sh /start.sh
RUN chmod +x /start.sh
CMD ["/start.sh"]
10 changes: 10 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Start MongoDB
mongod --fork --logpath /var/log/mongodb/mongod.log

# Wait for MongoDB to start (adjust the sleep duration as needed)
sleep 5

# Start your Java application
java -jar /url-shortener-images.jar

0 comments on commit d855f8d

Please sign in to comment.