-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
executable file
·147 lines (123 loc) · 5.41 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
FROM debian:sid as builder
LABEL maintainer "[email protected]"
LABEL version "201707-GA"
LABEL description "alfresco-standalone 201707-GA builder stage"
# Dependencies
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
cpp \
dirmngr \
gcc \
gpg \
gpg-agent \
openjdk-8-jdk \
libapr1 \
libapr1-dev \
lsof \
make \
tar \
unzip \
sed \
wget
# Environment variables
ENV ALF_VERSION=201707 \
ALF_BUILD=201707-build-00028 \
CATALINA_HOME=/usr/local/tomcat \
ALF_HOME=/usr/local/alfresco \
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 \
AOS_VERSION=1.1.6
ENV ALF_ZIP=alfresco-community-distribution-$ALF_VERSION.zip \
AOS_ZIP=alfresco-aos-module-$AOS_VERSION.zip \
AOS_AMP=alfresco-aos-module-$AOS_VERSION.amp
ENV ALF_DOWNLOAD_URL=https://download.alfresco.com/release/community/$ALF_BUILD/$ALF_ZIP \
AOS_DOWNLOAD_URL=https://download.alfresco.com/release/community/$ALF_BUILD/$AOS_ZIP \
DIST=/tmp/alfresco/alfresco-community-distribution-$ALF_VERSION
ENV PATH $CATALINA_HOME/bin:$ALF_HOME/bin:$PATH
# Create root folders
RUN set -x \
&& mkdir -p $ALF_HOME $CATALINA_HOME
# get alfresco ZIP
RUN set -x \
&& mkdir /tmp/alfresco \
&& wget --no-check-certificate $ALF_DOWNLOAD_URL \
&& unzip $ALF_ZIP -d /tmp/alfresco
# Alfresco basic instalation
RUN set -x \
&& ln -s $CATALINA_HOME $ALF_HOME/tomcat \
&& mkdir -p $CATALINA_HOME/conf/Catalina/localhost $CATALINA_HOME/lib/ $CATALINA_HOME/webapps \
&& mv $DIST/web-server/conf/Catalina/localhost/alfresco.xml $CATALINA_HOME/conf/Catalina/localhost/ \
&& mv $DIST/web-server/conf/Catalina/localhost/share.xml $CATALINA_HOME/conf/Catalina/localhost/ \
&& mv $DIST/web-server/lib/* $CATALINA_HOME/lib/ \
&& mv $DIST/web-server/shared $CATALINA_HOME/ \
&& mv $DIST/web-server/webapps/alfresco.war $CATALINA_HOME/webapps/ \
&& mv $DIST/web-server/webapps/share.war $CATALINA_HOME/webapps/ \
&& mv $DIST/web-server/webapps/ROOT.war $CATALINA_HOME/webapps/ \
&& mkdir $CATALINA_HOME/webapps/alfresco $CATALINA_HOME/webapps/share $CATALINA_HOME/webapps/ROOT \
&& unzip $CATALINA_HOME/webapps/alfresco.war -d $CATALINA_HOME/webapps/alfresco \
&& unzip $CATALINA_HOME/webapps/share.war -d $CATALINA_HOME/webapps/share \
&& unzip $CATALINA_HOME/webapps/ROOT.war -d $CATALINA_HOME/webapps/ROOT \
&& rm -rf $CATALINA_HOME/webapps/*.war \
&& mv $DIST/alf_data $ALF_HOME \
&& mv $DIST/amps $ALF_HOME \
&& mv $DIST/bin $ALF_HOME \
&& mv $DIST/modules $ALF_HOME
# alfresco-pdf-renderer
RUN set -x \
&& mkdir /usr/local/alfresco/alfresco-pdf-renderer \
&& wget https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/alfresco-pdf-renderer/1.0/alfresco-pdf-renderer-1.0-linux.tgz \
&& tar xzvf alfresco-pdf-renderer-1.0-linux.tgz -C /usr/local/alfresco/alfresco-pdf-renderer
# Configure Alfresco
COPY assets/alfresco/alfresco-global.properties $CATALINA_HOME/shared/classes/alfresco-global.properties
# Install Alfresco Office Services
RUN set -x \
&& mkdir /tmp/aos \
&& wget --no-check-certificate $AOS_DOWNLOAD_URL \
&& unzip $AOS_ZIP -d /tmp/aos \
&& mv /tmp/aos/extension/* $CATALINA_HOME/shared/classes/alfresco/extension \
&& mv /tmp/aos/$AOS_AMP $ALF_HOME/amps \
&& mkdir $CATALINA_HOME/webapps/_vti_bin \
&& unzip /tmp/aos/_vti_bin.war -d $CATALINA_HOME/webapps/_vti_bin
# Install addons
COPY assets/amps $ALF_HOME/amps
COPY assets/amps_share $ALF_HOME/amps_share
RUN set -x \
&& java -jar $ALF_HOME/bin/alfresco-mmt.jar install $ALF_HOME/amps $CATALINA_HOME/webapps/alfresco -directory -nobackup \
&& java -jar $ALF_HOME/bin/alfresco-mmt.jar install $ALF_HOME/amps_share $CATALINA_HOME/webapps/share -directory -nobackup
# Install api-explorer WAR file
RUN set -x \
&& wget https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/api-explorer/5.2.0/api-explorer-5.2.0.war -O $CATALINA_HOME/webapps/api-explorer.war \
&& mkdir $CATALINA_HOME/webapps/api-explorer \
&& unzip $CATALINA_HOME/webapps/api-explorer.war -d $CATALINA_HOME/webapps/api-explorer \
&& rm -rf $CATALINA_HOME/webapps/api-explorer.war
FROM tomcat:7-jre8
LABEL maintainer "[email protected]"
LABEL version "201707-GA"
LABEL description "alfresco-standalone 201707-GA application stage"
ENV CATALINA_HOME=/usr/local/tomcat \
ALF_HOME=/usr/local/alfresco
# Dependencies
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ghostscript \
imagemagick \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p $ALF_HOME $ALF_HOME/alf_data \
&& ln -s $CATALINA_HOME $ALF_HOME/tomcat
COPY --from=builder /usr/local/alfresco/bin /usr/local/alfresco/bin
COPY --from=builder /usr/local/alfresco/alfresco-pdf-renderer /usr/local/alfresco/alfresco-pdf-renderer
COPY --from=builder /usr/local/tomcat/lib/postgresql-9.4.1212.jar /usr/local/tomcat/lib/postgresql-9.4.1212.jar
COPY --from=builder /usr/local/tomcat/conf/Catalina /usr/local/tomcat/conf/Catalina
COPY --from=builder /usr/local/tomcat/shared /usr/local/tomcat/shared
COPY --from=builder /usr/local/tomcat/webapps /usr/local/tomcat/webapps
RUN set -x \
&& sed -i 's;shared.loader=;shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar;g' $CATALINA_HOME/conf/catalina.properties \
&& useradd -ms /bin/bash alfresco \
&& chown -RL alfresco:alfresco $ALF_HOME
USER alfresco
WORKDIR $ALF_HOME
EXPOSE 8080
VOLUME $ALF_HOME/alf_data
CMD ["catalina.sh", "run"]