-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.bak
78 lines (57 loc) · 2.65 KB
/
Dockerfile.bak
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
FROM ubuntu:20.04
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
#jdk8
RUN apt-get -q update && \
apt-get -y --no-install-recommends install curl git gnupg software-properties-common unzip && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x219BD9C9 && \
apt-add-repository "deb http://repos.azul.com/azure-only/zulu/apt stable main" && \
apt-get -q update && \
apt-get -y --no-install-recommends install zulu-8-azure-jdk=8.38.0.13 && \
rm -rf /var/lib/apt/lists/*
ENV JAVA_HOME=/usr/lib/jvm/zulu-8-azure-amd64
RUN java -version
RUN apt-get -q update && \
apt-get -y --no-install-recommends install wget vim curl git gnupg software-properties-common sshpass gawk expect iproute2 iproute2-doc apt-utils && \
rm -rf /var/lib/apt/lists/*
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update
RUN apt-get -y install postgresql
ENV LANG C.UTF-8
EXPOSE 8080
RUN groupadd tomcat
RUN useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
WORKDIR /tmp
RUN curl -O https://downloads.apache.org/tomcat/tomcat-8/v8.5.73/bin/apache-tomcat-8.5.73.tar.gz
RUN mkdir -p /opt/tomcat
RUN tar -xzf apache-tomcat-*.tar.gz -C /opt/tomcat --strip-components=1
#RUN unzip apache-tomcat-8.5.73.zip -d /opt/tomcat
WORKDIR /opt/tomcat
RUN chgrp -R tomcat /opt/tomcat
RUN chmod -R g+r conf
RUN chmod g+x conf
RUN chown -R tomcat webapps/ work/ temp/ logs/
WORKDIR /app
RUN git clone https://github.com/axelor/open-suite-webapp.git axelor-erp
RUN sed -e 's|[email protected]:|https://github.com/|' -i axelor-erp/.gitmodules
WORKDIR /app/axelor-erp
RUN git checkout master
RUN git submodule sync
RUN git submodule init
RUN git submodule update
RUN git submodule foreach git checkout master
RUN git submodule foreach git pull origin master
RUN ./gradlew -x test build
RUN cp /app/axelor-erp/src/main/resources/application.properties /opt/tomcat/application.properties
RUN sed 's|{java.io.tmpdir}/axelor|{user.home}/.axelor/axelor-erp/5.0|g' -i /opt/tomcat/application.properties
RUN cp /app/axelor-erp/build/libs/axelor-erp-*.war /opt/tomcat/webapps/ROOT.war
WORKDIR /opt/tomcat/webapps
RUN rm -R ROOT
RUN unzip ROOT.war -d ROOT
#RUN chown tomcat:tomcat /usr/local/tomcat/webapps/ROOT.war
#RUN export JAVA_OPTS=-Daxelor.config=/usr/local/tomcat/application.properties
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENV CATALINA_HOME /opt/tomcat
#ENTRYPOINT /usr/local/bin/entrypoint.sh start
CMD bash /opt/tomcat/bin/catalina.sh run