I have a spring-boot app which talks to couchbase. I build the spring app as a docker image. There are some preconditions that need to be fulfilled in couchbase set up in order for the app to run. When I run my couchbase image first and then run my spring-boot app image everything runs fine. However, I need this to be automated and run from a docker-compose file meaning by a single docker-compose up command I should be able to run the couchbase image first, configure it with all presettings and then start to run the spring-boot app. I ran into quite a few discussion threads, but unfortunately I am not able to make it work somehow. I tried using cmd and entrypoint, but without success. Here is my docker-compose file
version: "2"
services:
expensetracker-cb:
image: chakrar27/expensetracker-cb
command: sh test_hello.sh
ports:
- 8080:8080
depends_on:
- mycouchbase
mycouchbase:
image: chakrar27/couchbase_new_10_08_2016
ports:
- 8091:8091
- 8092:8092
- 8093:8093
- 8094:8094
- 11210:11210
In fact it doesn't trigger the test_hello.sh at all. Here's the dockerfile for the spring-boot expensetracker app
FROM frolvlad/alpine-oraclejdk8:slim
VOLUME /tmp
ADD expensetracker-cb-0.1.0.jar app.jar
RUN sh -c 'touch /app.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Can someone please help?