Public Repository

Last pushed: 2 years ago
Short Description
Play framework default setup with Spring Data, JPA, Hibernate entity manager, Mysql - ubuntu
Full Description

Play framework default setup with spring-data, JPA, mysql, ubuntu

Start container using following command

docker run -d -p 80:9000 nishith1005/play-spring-data-jpa-mysql-java

make sure port 80 is available

Dockerfile :

Base Image

FROM ubuntu
MAINTAINER Nishith lucky1005@gmail.com

ENV LANG C.UTF-8

RUN apt-get upgrade
RUN apt-get -yqq update

Install Mysql

RUN apt-get install -y git mysql-server mysql-client supervisor
RUN /bin/bash -c "/usr/bin/mysqld_safe &" && \
sleep 5 && \
mysql -u root -e "CREATE DATABASE student1" && \
mysql -u root -e"SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root');"

Install Java.

RUN \
apt-get install -y software-properties-common && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer

ADD start-activator.sh /start-activator.sh
ADD start-mysqld.sh /start-mysqld.sh
ADD run.sh /run.sh
RUN chmod 755 /*.sh
ADD supervisord-activator.conf /etc/supervisor/conf.d/supervisord-activator.conf
ADD supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf

Define commonly used JAVA_HOME variable

ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

ADD basic play framework APP with spring data, JPA, Mysql, Hibernate entity manager and Mysql

RUN mkdir /app
WORKDIR /app
ADD app /app
ENV PATH $PATH:/app

EXPOSE 9000

CMD ["/run.sh"]

check for /var/log/supervisor/activator-stdout---supervisor-XXXX.log for details

Docker Pull Command
Owner
nishith1005

Comments (0)