forked from atcol/docker-registry-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (27 loc) · 1.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM ubuntu
# Install java and tomcat
RUN apt-get update && apt-get install -y tomcat8 openjdk-8-jdk curl
RUN mkdir /var/lib/h2 && chmod a+rw /var/lib/h2
RUN rm -rf /var/lib/tomcat8/webapps/*
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
# Install grails and project dependencies
WORKDIR /work
ADD grailsw /work/grailsw
ADD wrapper /work/wrapper
ADD application.properties /work/application.properties
ADD grails-app/conf/BuildConfig.groovy /work/grails-app/conf/BuildConfig.groovy
RUN ./grailsw help
# Add project files and build a war
ADD . /work
RUN ./grailsw war
RUN cp target/docker-registry-ui-*.war /var/lib/tomcat8/webapps/ROOT.war
# Update catalina configuration
WORKDIR /usr/share/tomcat8/bin/
ADD startup.sh /usr/share/tomcat8/bin/custom-startup.sh
RUN chmod +x /usr/share/tomcat8/bin/custom-startup.sh
# Clean up the installation
RUN apt-get purge -y curl
EXPOSE 8080
VOLUME ["/var/lib/h2/", "/var/lib/tomcat8"]
ENV CATALINA_BASE /var/lib/tomcat8
CMD /usr/share/tomcat8/bin/custom-startup.sh