-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (56 loc) · 2.65 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
FROM debian:stretch
MAINTAINER Marc Richter <[email protected]>
# setup useful environment variables
ENV CONF_VERSION 6.11.0
ENV CONF_INST /usr/local/atlassian/confluence
ENV CONF_HOME ${CONF_INST}-data
ENV CONF_SETENV ${CONF_INST}/bin/setenv.sh
ENV PG_VERSION 9.6
ENV JAVA_MINOR 8
ENV JAVA_UPDATE 181
ENV JAVA_VERSION 1.${JAVA_MINOR}.0_${JAVA_UPDATE}
ENV JAVA_VERSION_FULL ${JAVA_MINOR}u${JAVA_UPDATE}-b13
ENV JAVA_MD5 96a7b8442fe848ef90c96a2fad6ed6d1
ENV JAVA_HOME /opt/jdk/jdk${JAVA_VERSION}
ENV DEBIAN_FRONTEND noninteractive
# Update System and install necessary packages
RUN set -x \
&& apt-get update -q \
&& apt-get dist-upgrade -y -q \
&& apt-get install -y -q apt-utils \
&& apt-get install -y -q postgresql-${PG_VERSION} postgresql-client wget curl locales-all
# Create needed folders
RUN set -x \
&& mkdir -p "${CONF_HOME}" "${CONF_INST}"
# Prepare PostgreSQL
RUN set -x \
&& pg_dropcluster ${PG_VERSION} main \
&& pg_createcluster --locale='en_US.UTF-8' ${PG_VERSION} main \
&& sed -i'' 's/peer/trust/g' /etc/postgresql/${PG_VERSION}/main/pg_hba.conf \
&& sed -i'' 's/md5/trust/g' /etc/postgresql/${PG_VERSION}/main/pg_hba.conf \
&& pg_ctlcluster ${PG_VERSION} main start -- -w \
&& /usr/bin/psql -U postgres -c "CREATE DATABASE confluence ENCODING = 'UTF8';" \
&& pg_ctlcluster ${PG_VERSION} main stop -- -m fast
COPY startup.sh /startup.sh
RUN chmod +x /startup.sh
# Grab Confluence, extract it and prepare folders and configs
RUN set -x \
&& curl -Ls "https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-${CONF_VERSION}.tar.gz" \
| tar -xz --directory "${CONF_INST}/" --strip-components=1 \
&& chmod -R 777 "${CONF_INST}/temp" \
&& chmod -R 777 "${CONF_INST}/logs" \
&& chmod -R 777 "${CONF_INST}/work" \
&& echo -e "\nconfluence.home=${CONF_HOME}" >> "${CONF_INST}/confluence/WEB-INF/classes/confluence-init.properties"
# Tune Confluence Settings
RUN set -x \
&& sed -i'' 's#Xmx1024m#Xmx2048m#g' ${CONF_SETENV}
# Install Oracle JDK
RUN mkdir -p /opt/jdk \
&& wget --no-cookies --no-check-certificate -q --header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_FULL}/${JAVA_MD5}/jdk-${JAVA_MINOR}u${JAVA_UPDATE}-linux-x64.tar.gz -O - \
| tar xfz - -C /opt/jdk
RUN update-alternatives --install /usr/bin/java java /opt/jdk/jdk${JAVA_VERSION}/bin/java 100
RUN update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk${JAVA_VERSION}/bin/javac 100
EXPOSE 8090
EXPOSE 8080
CMD ["/startup.sh"]