Commit 1005c82b authored by Elias Englmeier's avatar Elias Englmeier
Browse files

simpler dockerfile

parent 5947e177
FROM openjdk:8
RUN mkdir /srv/java-docker-example
COPY classification-1.0-SNAPSHOT.jar /srv/classification-1.0-SNAPSHOT.jar
COPY config.yml /srv/java-docker-example/
ADD classification-1.0-SNAPSHOT.jar ./classification-1.0-SNAPSHOT.jar
# https://github.com/docker-library/docs/tree/master/mysql#no-connections-until-mysql-init-completes
# https://github.com/jwilder/dockerize
ENV DOCKERIZE_VERSION v0.3.0
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
ADD config.yml ./config.yml
# wait for mysql to pass a healthcheck before starting the dropwizard service
# it can't handle the database being down when the app starts up
CMD java -jar classification-1.0-SNAPSHOT.jar server ./config.yml
CMD dockerize -wait tcp://db:3306 -timeout 100s /usr/bin/java -jar /srv/java-docker-example/classification-1.0-SNAPSHOT.jar server /srv/java-docker-example/config.yml
EXPOSE 9000 9001
EXPOSE 9000 9001
\ No newline at end of file
......@@ -5,9 +5,9 @@ How to start the classificationservice application
1. Run `mvn clean install` to build your application
1. Start application with `java -jar target/classification-1.0-SNAPSHOT.jar server config.yml`
1. To check that your application is running enter url `http://localhost:8080`
1. To check that your application is running enter url `http://localhost:9000`
Health Check
---
To see your applications health enter url `http://localhost:8081/healthcheck`
To see your applications health enter url `http://localhost:9001/healthcheck`
......@@ -34,4 +34,4 @@ database:
# the password
password: root
# the JDBC URL; the database is called tmms
url: jdbc:mysql://localhost/tmms
\ No newline at end of file
url: jdbc:mysql://localhost:3306/tmms
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment