Commit 035316e6 authored by damianofalcioni's avatar damianofalcioni

Initial release

parent 5bf469b5
# microservice-controller-docker
This project contain the Dockerized version of the [microservice-controller-rest](../microservice-controller-rest).
Instructions to build and start the microservice-controller container:
1) Build the image
<pre>
sudo docker build --no-cache -f msc-Dockerfile .
</pre>
2) Enable Persistence
<pre>
sudo docker create --name app _id_from_build_
mkdir ./msc-data
sudo docker cp app:/opt/msc-data ./msc-data
</pre>
3) Run the container
<pre>
sudo docker run -it -p 8080:8080 -v ${PWD}/msc-data:/opt/msc-data _id_from_build_
</pre>
\ No newline at end of file
#Build:
# sudo docker build --no-cache -f msc-Dockerfile .
#
#Enable Persistence:
# sudo docker create --name app _id_from_build_
# mkdir ./msc-data
# sudo docker cp app:/opt/msc-data ./msc-data
#
#Run:
# sudo docker run -it -p 8080:8080 -v ${PWD}/msc-data:/opt/msc-data _id_from_build_
#
#TODO
#- Create a script to move the services configuration at runtime
#
FROM tomcat:8.5-jdk8
# set bash instead of sh as default shell for RUN
SHELL ["/bin/bash", "-c"]
# maven setup to compile the sources
RUN \
apt-get -q update && \
apt-get -qy install maven
# MSC compilation, deployment and configuration
ENV msc_log=/opt/msc-data/msc.log
ENV msc_upload_dir=/opt/msc-data/adoxx_msc_upload/
ENV msc_service_dir=/opt/msc-data/adoxx_msc_services/
RUN \
wget https://git.boc-group.eu/adoxx/microservice-controller/-/archive/master/microservice-controller-master.tar.gz -O /opt/microservice-controller-master.tar.gz && \
tar xzpf /opt/microservice-controller-master.tar.gz -C /opt && \
rm /opt/microservice-controller-master.tar.gz && \
mvn -B -f /opt/microservice-controller-master/pom.xml clean install && \
wget https://git.boc-group.eu/adoxx/microservice-controller-rest/-/archive/master/microservice-controller-rest-master.tar.gz -O /opt/microservice-controller-rest-master.tar.gz && \
tar xzpf /opt/microservice-controller-rest-master.tar.gz -C /opt && \
rm /opt/microservice-controller-rest-master.tar.gz && \
mvn -B -f /opt/microservice-controller-rest-master/pom.xml clean package && \
unzip /opt/microservice-controller-rest-master/target/micro-service-controller-rest.war -d /usr/local/tomcat/webapps/msc/ && \
rm -r /opt/microservice-controller-rest-master && \
echo '{"microservicesDefinitionFolder":"'${msc_service_dir}'","uploadFolder":"'${msc_upload_dir}'","logFileName":"'${msc_log}'","autostartEnabled":true}' > /usr/local/tomcat/webapps/msc/WEB-INF/classes/org/adoxx/microservice/api/rest/config.json
# maven cleanup
RUN \
apt-get -qy purge maven && \
apt-get -qy autoremove && \
rm -r /root/.m2/
EXPOSE 8080
\ No newline at end of file
Markdown is supported
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