├── Dockerfile ├── README.md ├── apply_amps_unatended.sh ├── create.sql ├── custom-surf-application-context.xml ├── disable-delbackup-context.xml ├── docker-compose.yml ├── docloud-example.sh ├── entry.sh ├── install.sh ├── modifinitpass.sh ├── nginx-alfresco-80 ├── .env ├── docker-compose.yml └── nginx │ └── alfresco.conf ├── passencode.py ├── protectnodes.amp ├── setenv.sh ├── startcontainerexample.sh ├── tuneglobal.sh ├── tunerepo.sh ├── tunesolr.sh ├── waitready.sh └── yml-with-volumes ├── .env └── docker-compose.yml /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:xenial 2 | MAINTAINER Philippe Dubois 3 | ENV DEBIAN_FRONTEND noninteractive 4 | RUN apt-get update && apt-get install -y --no-install-recommends ubuntu-desktop && apt-get update && apt-get install -y wget && wget https://sourceforge.net/projects/alfresco/files/Alfresco%20201707%20Community/alfresco-community-installer-201707-linux-x64.bin && chmod +x ./*.bin 5 | # make root readable by others 6 | RUN chmod go+r /root 7 | COPY passencode.py / 8 | COPY modifinitpass.sh / 9 | COPY tunesolr.sh / 10 | COPY tunerepo.sh / 11 | COPY setenv.sh / 12 | COPY disable-delbackup-context.xml / 13 | RUN chmod +x /passencode.py && chmod +x /modifinitpass.sh && chmod +x /tunesolr.sh && chmod +x /tunerepo.sh && chmod +x setenv.sh 14 | RUN apt-get update && apt-get install -y curl 15 | COPY waitready.sh / 16 | RUN chmod +x /waitready.sh 17 | COPY entry.sh / 18 | RUN chmod +x /entry.sh 19 | COPY tuneglobal.sh / 20 | RUN chmod +x /tuneglobal.sh 21 | COPY protectnodes.amp / 22 | # apply amps 23 | COPY apply_amps_unatended.sh / 24 | RUN chmod +x /apply_amps_unatended.sh 25 | # configure for allowing and managing correctly user names containing '@', see http://docs.alfresco.com/4.2/tasks/usernametypes-mix-config.html 26 | COPY /custom-surf-application-context.xml / 27 | # RUN mv /custom-surf-application-context.xml /opt/alfresco/tomcat/shared/classes/alfresco/web-extension 28 | COPY install.sh / 29 | # run the installer inside image build 30 | RUN ./alfresco-community-installer-201707-linux-x64.bin --mode unattended --alfresco_admin_password admin --prefix /opt/alfresco 31 | RUN rm ./alfresco-community-installer-201707-linux-x64.bin 32 | RUN mv /opt/alfresco/tomcat/bin/setenv.sh /opt/alfresco/tomcat/bin/setenv.sh.back 33 | RUN mv /setenv.sh /opt/alfresco/tomcat/bin/setenv.sh 34 | RUN mv /opt/alfresco/alf_data /opt/alfresco/alf_data_back 35 | RUN mkdir /opt/alfresco/alf_data 36 | COPY create.sql / 37 | RUN apt-get update && apt-get install -y vim 38 | # test if alfresco server alive and responsive 39 | HEALTHCHECK --interval=1m --timeout=5s \ 40 | CMD curl -f http://localhost:8080/alfresco || exit 1 41 | EXPOSE 8443 42 | ENTRYPOINT ["/entry.sh"] 43 | 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-alfresco 2 | 3 | 4 | Generate a docker Ubuntu based image for Alfresco Community v5.2.0 with Alfresco Share v5.2.f (see https://sourceforge.net/projects/alfresco/files/Alfresco%20201707%20Community/alfresco-community-installer-201707-linux-x64.bin) 5 | 6 | ## Description 7 | 8 | 9 | The Dockerfile builds from "dockerfile/ubuntu" see https://hub.docker.com/_/ubuntu/ 10 | 11 | - Installs "ubuntu-desktop" required for Alfresco transformation 12 | - Dockerfile defines an "ENTRYPOINT" performing following configurations when containter is started first: 13 | - Reduces system.content.orphanProtectDays to 1. Goal, saving space by reducing how long "orphan" content is kept. 14 | - Disable "deletedContentBackupListener" transfering deleted content files to "contentstore.deleted" no need 15 | to empty the folder manually to recuperate physical space. 16 | - modifinitpass.sh reinitialize the initial repo password or "admin" to value of the INITIAL_PASS env variable 17 | passed when container initialy started 18 | - tunesolr.sh disable solr encription between solr and alfresco for small cpu gain. solr and alfresco backend 19 | are installed on same server. 20 | - starts Alfresco 21 | - Environment variables having name starting with "ALF_xxx" that are passed using the -e options will be copied or value updated in "alfresco-global.properties". 22 | Example: -e ALF_22=share.protocol=https will indicate that protocol for share is https and configuration line will be inserted or updated accordingly in "alfresco-global.properties" 23 | - Subsequent container start is only starting Alfresco adding or updating configuration passed using -e ALF_xxx=conf line. A configuration example on how to pass configuration to Alfresco within the container is included. See: startcontainerexample.sh 24 | - Configured [alfrescoprotectnode](https://github.com/pdubois/alfrescoprotectnode) to protect some "well known" nodes against acidental deletion. 25 | - Some support for [dockercloud](https://www.docker.com/products/docker-cloud) is included. It allows fast deployment of containers in the cloud on Azure, Digital Ocean, AWS, and SoftLayer. 26 | 27 | 28 | ## To generate the image from "Dockerfile" 29 | 30 | ``` 31 | cd _folder-containing-Dockerfile_ 32 | sudo docker build -t _image-name_ . 33 | ``` 34 | 35 | Examples: 36 | 37 | ``` 38 | sudo docker build -t alfresco-5.2.0 . 39 | ``` 40 | 41 | A more complete example is located [here](https://github.com/pdubois/docker-alfresco/blob/master/startcontainerexample.sh) 42 | 43 | 44 | ## To start a container using the image 45 | 46 | 47 | ``` 48 | sudo docker run -d -e INITIAL_PASS=_initial-pass_ -t -i -p 8443:8443 _image-name_ 49 | ``` 50 | 51 | Example: 52 | 53 | ``` 54 | sudo docker run -d -e INITIAL_PASS=admun -t -i -p 8443:8443 alfresco-5.2.0 55 | ``` 56 | 57 | Note: 58 | 59 | Fortunately you can download the pre build image from the corresponding [docker hub automatic build](https://registry.hub.docker.com/u/pdubois/docker-alfresco/) using the following command. 60 | 61 | ``` 62 | docker pull pdubois/docker-alfresco 63 | ``` 64 | 65 | Values for jvm heap size can be specified using the "XMX" and "XMS" parameters. "XMX" value corresponds to the "-XmxM" and "XMS" to "-XmsM". Default values for for Xmx and Xms are both 2048M. 66 | 67 | Example: 68 | 69 | 70 | ``` 71 | sudo docker run -d -e INITIAL_PASS=admun -e XMS=1024 -e XMX=5120 -t -i -p 8443:8443 alfresco-5.2.0 72 | ``` 73 | 74 | 75 | 76 | ## To stop your container 77 | 78 | ``` 79 | sudo docker stop -t 80 | ``` 81 | 82 | The above command will stop your container with a grace period of SECONDS. Grace period gives the opportunity to alfresco process to stop gracefully ( example: flushing buffers). 83 | The “entry.sh” script executed while starting traps SIGTERM signal and calls execute “/opt/alfresco/alfresco.sh stop” when container is stopped. 84 | 85 | Exit code of the container can be checked using following command: 86 | 87 | ``` 88 | sudo docker inspect -f '{{.State.ExitCode}}' 89 | ``` 90 | 91 | Under normal circumstance exit code should be “0”. Reasonable value for "SECONDS" is 60. 92 | 93 | ## Deploying using dockercloud procedure 94 | 95 | - First register with [dockercloud](https://docs.docker.com/docker-cloud/) 96 | - [bring in your own node](https://docs.docker.com/docker-cloud/infrastructure/byoh/) in dockercloud. 97 | - Install [dockercloud CLI](https://docs.docker.com/docker-cloud/installing-cli/). Tested using the docker deployement of dockercloud CLI image therefore you need docker installed on the host used to deploy (probably your laptop). 98 | - Get from dockercloud your DOCKERCLOUD_USER and your DOCKERCLOUD_PASS. 99 | - Get [docloud-example.sh](https://github.com/pdubois/docker-alfresco/blob/master/docloud-example.sh) 100 | - Replace with your DOCKERCLOUD_USER and your DOCKERCLOUD_PASS. 101 | - Make "docloud-example.sh" executable and execute it! 102 | 103 | 104 | ## Storing index, content and database outside of containers 105 | 106 | The approach applied is to use dedicated container for volume sharing between host and container. 107 | 108 | ### Step 1: 109 | 110 | Decide where to locate your content, index and database files on your host and create directory for it. 111 | 112 | Example: 113 | 114 | ``` 115 | mkdir /home/phil/compose/alf_data 116 | ``` 117 | 118 | ### Step 2: 119 | 120 | Creating the container for content, index and database pointing to the folder created in Step1 121 | 122 | 123 | Example: 124 | 125 | ``` 126 | docker create -v /home/phil/compose/alf_data:/opt/alfresco/alf_data --name phil-volumes ubuntu /bin/true 127 | ``` 128 | 129 | Notes: 130 | 131 | - The above container does not run anything, it has to exist and publishes a volume (-v internal-container-path:host-path). 132 | - With "-v /home/phil/compose/alf_data:/opt/alfresco/alf_data" defines a mapping between container and host file system. 133 | "/home/phil/compose/alf_data" is the path to "alf_data" from inside the container and "/opt/alfresco/alf_data" the path 134 | to same "alf_data" on your host. 135 | 136 | 137 | 138 | ### Step 3: 139 | 140 | Start your container using volume from container created on "Step 2" 141 | 142 | ``` 143 | 144 | docker run -d -e INITIAL_PASS=admun \ 145 | -e ALF_1=mail.host=smtp.gmail.com \ 146 | put your options here... 147 | --volumes-from phil-volumes \ 148 | -t -i -p 8450:8443 pdubois/docker-alfresco 149 | ``` 150 | 151 | Notes: 152 | 153 | - The created container will be **throw-away containers/disposable** because all the Alfresco related data state 154 | (index, DB and content) is located under "/opt/alfresco/alf_data" on the container. 155 | - The rest of the state is Alfresco deployment related (configuration files, Tomcat server, DB server ...) is located in the image 156 | (pdubois/docker-alfresco in this example) or in specific options (-e < ... >). Therefore a container instance can be restarted 157 | using the similar "docker run ..." command eventually with different options if different configuration is required. 158 | - To create a backup, you only need to backup what is located under your "data" directory on the host 159 | ( /opt/alfresco/alf_data in the example ). 160 | 161 | The same can be achieved using a single command "docker-compose": 162 | 163 | The ***"./yml-with-volumes/docker-compose.yml"*** under stack descriptor can be used as follows 164 | 165 | ``` 166 | version: '3' 167 | services: 168 | alfresco: 169 | image: "pdubois/docker-alfresco:master" 170 | volumes: 171 | - ${INDEX_AND_DATA}:/opt/alfresco/alf_data 172 | ports: 173 | - "8443" 174 | environment: 175 | - INITIAL_PASS=admun 176 | 177 | ``` 178 | 179 | Adjust value in of "INDEX_AND_DATA" in ".env" file to indicate your index, content and DB files location on your host. From the "./yml-with-volumes" folder start stack with 180 | 181 | ``` 182 | sudo docker-compose up 183 | ``` 184 | 185 | 186 | 187 | 188 | ## Running Alfresco and database in separate containers 189 | 190 | Depending on the environment variable **CONTAINER_FUNCTION** value passed when running container your container will run Alfresco and postgres together if **CONTAINER_FUNCTION** is undefined. If **CONTAINER_FUNCTION** equals ***tomcat*** it will start tomcat with Alfresco deployed but no DB. DB will run in a separate container called **postgres3** in the example here under. Database creation script will be ran from the "tomcat" container when started initially. 191 | 192 | ### Examples: 193 | 194 | #### Running a stack using "docker run" and "docker-compose" 195 | 196 | To run this example a dedicated docker network will be created (see: https://docs.docker.com/engine/userguide/networking/) 197 | 198 | ``` 199 | 200 | # create a dedicated network to run in isolation 201 | docker network create --driver bridge isolated_nw 202 | # starting db tier on the network 203 | docker run --network=isolated_nw --name postgres3 -e POSTGRES_PASSWORD=mysecretpassword -d postgres:9.4.4 204 | # starting Alfresco tier 205 | docker run --network=isolated_nw -d -e INITIAL_PASS=admun -e CONTAINER_FUNCTION=tomcat -e ALF_1='db.url.EQ.jdbc:postgresql:\/\/postgres3:5432\/${db.name}' -e ALF_2='db.password.EQ.mysecretpassword' -e DB_CONTAINER_NAME=postgres3 -e ALF_3='db.username.EQ.postgres' -t -i -p 8443 alfresco 206 | ``` 207 | 208 | Alternatively, you can use [docker-compose](https://docs.docker.com/compose/) to start database container and Alfresco tier in one single command. Here under the **docker-compose.yml** file content: 209 | 210 | ``` 211 | version: '2' 212 | services: 213 | alfresco: 214 | image: "pdubois/docker-alfresco:master" 215 | ports: 216 | - "8443" 217 | environment: 218 | - INITIAL_PASS=admun 219 | - CONTAINER_FUNCTION=tomcat 220 | - ALF_1=db.url.EQ.jdbc:postgresql:\/\/postgres:5432\/alfresco 221 | - ALF_2=db.password.EQ.mysecretpassword 222 | - ALF_3=db.username.EQ.postgres 223 | - DB_CONTAINER_NAME=postgres 224 | depends_on: 225 | - postgres 226 | postgres: 227 | image: postgres:9.4.4 228 | environment: 229 | - POSTGRES_PASSWORD=mysecretpassword 230 | ``` 231 | 232 | To start the stack in a single command: 233 | 234 | ``` 235 | docker-compose up 236 | ``` 237 | 238 | A more complete example including [search server 1.0.0 based on SOLR6](https://sourceforge.net/projects/alfresco/files/Alfresco%20201702%20Community/alfresco-search-services-1.0.0.zip) can be found [here](https://hub.docker.com/r/pdubois/solr6/) 239 | 240 | 241 | #### Running Alfresco on port 80 with nginx server 242 | 243 | The folder ***nginx-alfresco-80*** contains a yml file starting Alfresco on port 80 havin ***nginx*** in front of it. 244 | 245 | Before starting it with ***"docker-compose up"*** host name you are deploying to should be set in ***".env"*** file. 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | -------------------------------------------------------------------------------- /apply_amps_unatended.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ------- 3 | # Script for apply AMPs to installed WAR 4 | # ------- 5 | set -e 6 | pushd $(dirname $0)>/dev/null 7 | export SCRIPTPATH=$(pwd) 8 | export ALF_HOME=${SCRIPTPATH%/*} 9 | export CATALINA_HOME=$ALF_HOME/tomcat 10 | required_java_version="1.7" 11 | 12 | if [ -f $CATALINA_HOME/bin/setenv.sh ]; then 13 | . $CATALINA_HOME/bin/setenv.sh 14 | fi 15 | 16 | # Verify Java installation into ALF_HOME folder 17 | if [ -f $ALF_HOME/java/bin/java ] && [ -x $ALF_HOME/java/bin/java ]; then 18 | echo 19 | echo "Found java executable in $ALF_HOME/java" 20 | _java=$ALF_HOME/java/bin/java 21 | 22 | # Verify Java installation into JAVA_HOME 23 | elif [ -n "$JAVA_HOME" ] && [ -x "$JAVA_HOME/bin/java" ]; then 24 | echo 25 | echo "Found java executable in JAVA_HOME: $JAVA_HOME" 26 | 27 | _java="$JAVA_HOME/bin/java" 28 | 29 | # Verify Java installation from linux repositories 30 | elif type -p java; then 31 | echo 32 | echo "Found installed java executable on the system" 33 | 34 | _java=java 35 | 36 | else 37 | echo 38 | echo "Java is not installed . . . The required Java version is $required_java_version or higher" 39 | echo "Please install Java and try again. Script will be closed. " 40 | # read DUMMY 41 | exit 15 42 | fi 43 | 44 | echo 45 | echo "This script will apply all the AMPs in amps and amps_share to the alfresco.war and share.war files in $CATALINA_HOME/webapps" 46 | echo "Press control-c to stop this script . . ." 47 | echo "Press any other key to continue . . ." 48 | # read RESP 49 | { 50 | $_java -jar $ALF_HOME/bin/alfresco-mmt.jar install $ALF_HOME/amps $CATALINA_HOME/webapps/alfresco.war -directory $* -force 51 | $_java -jar $ALF_HOME/bin/alfresco-mmt.jar list $CATALINA_HOME/webapps/alfresco.war 52 | $_java -jar $ALF_HOME/bin/alfresco-mmt.jar install $ALF_HOME/amps_share $CATALINA_HOME/webapps/share.war -directory $* -force 53 | $_java -jar $ALF_HOME/bin/alfresco-mmt.jar list $CATALINA_HOME/webapps/share.war 54 | } || 55 | { 56 | echo 57 | echo "Error. Appling of the AMPs is failed. See error message above." 58 | echo 59 | } 60 | echo "About to clean out $ALF_HOME/tomcat/webapps/alfresco and share directories and temporary files..." 61 | echo "Press control-c to stop this script . . ." 62 | echo "Press any other key to continue . . ." 63 | # read DUMMY 64 | rm -rf $CATALINA_HOME/webapps/alfresco 65 | rm -rf $CATALINA_HOME/webapps/share 66 | . $ALF_HOME/bin/clean_tomcat.sh 67 | popd>/dev/null 68 | -------------------------------------------------------------------------------- /create.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE alfresco WITH OWNER = postgres ENCODING = 'UTF8' TABLESPACE = pg_default CONNECTION LIMIT = -1; 2 | 3 | -------------------------------------------------------------------------------- /custom-surf-application-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | alfresco/site-data/${objectTypeIds} 13 | false 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /disable-delbackup-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | alfresco: 4 | image: "pdubois/docker-alfresco:master" 5 | ports: 6 | - "8443" 7 | environment: 8 | - INITIAL_PASS=admun 9 | - CONTAINER_FUNCTION=tomcat 10 | - ALF_1=db.url.EQ.jdbc:postgresql:\/\/postgres:5432\/alfresco 11 | - ALF_2=db.password.EQ.mysecretpassword 12 | - ALF_3=db.username.EQ.postgres 13 | - DB_CONTAINER_NAME=postgres 14 | depends_on: 15 | - postgres 16 | postgres: 17 | image: postgres:9.4.4 18 | environment: 19 | - POSTGRES_PASSWORD=mysecretpassword 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docloud-example.sh: -------------------------------------------------------------------------------- 1 | sudo docker run -it -e DOCKERCLOUD_USER=pdubois -e DOCKERCLOUD_PASS=xxxxxxxxxxx --rm dockercloud/cli service run \ 2 | -e INITIAL_PASS=admun \ 3 | -e ALF_1=mail.host.EQ.smtp.gmail.com \ 4 | -e ALF_2=mail.port.EQ.587 \ 5 | -e ALF_3=mail.username.EQ.xxxxx@gmail.com \ 6 | -e ALF_4=mail.password.EQ.xxxxxxx \ 7 | -e ALF_5=mail.protocol.EQ.smtp \ 8 | -e ALF_6=mail.encoding.EQ.UTF-8 \ 9 | -e ALF_7=mail.from.default.EQ.pdubois824@gmail.com \ 10 | -e ALF_8=mail.smtp.starttls.enable.EQ.true \ 11 | -e ALF_9=mail.smtp.auth.EQ.true \ 12 | -e ALF_10=mail.smtp.debug.EQ.false \ 13 | -e ALF_11=mail.testmessage.send.EQ.true \ 14 | -e ALF_12=mail.testmessage.to.EQ.xxxxxx@gmail.com \ 15 | -e ALF_13=mail.testmessage.subject.EQ."Outbound SMTP" \ 16 | -e ALF_14=mail.testmessage.text.EQ."The Outbound SMTP email subsystem is working." \ 17 | -e ALF_15=mail.smtp.socketFactory.port.EQ.587 \ 18 | -e ALF_16=mail.smtp.socketFactory.class.EQ.javax.net.ssl.SSLSocketFactory \ 19 | -e ALF_17=mail.smtp.socketFactory.fallback.EQ.false \ 20 | -e ALF_18=share.context.EQ.alfresco-test-docker \ 21 | -e ALF_19=share.host.EQ.146.185.143.92 \ 22 | -e ALF_20=share.port.EQ.8443 \ 23 | -e ALF_21=share.protocol.EQ.https \ 24 | -e ALF_22=share.protocol.EQ.https \ 25 | -p 8449:8443 pdubois/docker-alfresco:master 26 | 27 | 28 | -------------------------------------------------------------------------------- /entry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # trap SIGTERM and gracefully stops alfresco 3 | trap '/opt/alfresco/alfresco.sh stop;exit 0' SIGTERM 4 | set -e 5 | if [ ! -f /opt/alfresco/alf_data/foo.txt ]; then 6 | cp -Rp /opt/alfresco/alf_data_back/* /opt/alfresco/alf_data; 7 | bash /install.sh; 8 | bash /tunerepo.sh; 9 | bash /modifinitpass.sh; 10 | # /opt/alfresco/alfresco.sh start; 11 | # /waitready.sh; 12 | # /opt/alfresco/alfresco.sh stop; 13 | if [ -z ${CONTAINER_FUNCTION+x} ]; then 14 | echo "Tomcat and Postgres running in same container"; 15 | else 16 | echo "Creating DB from alfresco contaner"; 17 | export PGPASSWORD=mysecretpassword;/opt/alfresco/postgresql/bin/psql -h "$DB_CONTAINER_NAME" -p "5432" -U postgres < /create.sql 18 | fi 19 | echo "After fi1"; 20 | bash /tunesolr.sh; 21 | echo "After fi2"; 22 | touch /opt/alfresco/alf_data/foo.txt; 23 | echo "After fi3" 24 | fi 25 | echo "After fi4"; 26 | # setting values for all the "-e ALF_xxx=..." parameters provided at startup 27 | bash /tuneglobal.sh 28 | echo "After fi5"; 29 | # start postgres and alfresco separately 30 | if [ -z ${CONTAINER_FUNCTION+x} ]; then 31 | echo "Tomcat and Postgres running in same container"; 32 | /opt/alfresco/alfresco.sh start; 33 | else 34 | 35 | echo "Running only $CONTAINER_FUNCTION"; 36 | /opt/alfresco/alfresco.sh start $CONTAINER_FUNCTION; 37 | fi 38 | echo "After fi6"; 39 | 40 | # dumping logs to stdout 41 | tail -F /opt/alfresco/alfresco.log -F /opt/alfresco/share.log -F /opt/alfresco/solr.log 42 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | # Moved installation in Dockerfile 4 | mv /apply_amps_unatended.sh /opt/alfresco/bin 5 | mv /protectnodes.amp /opt/alfresco/amps 6 | /opt/alfresco/bin/apply_amps_unatended.sh 7 | mv /custom-surf-application-context.xml /opt/alfresco/tomcat/shared/classes/alfresco/web-extension 8 | -------------------------------------------------------------------------------- /modifinitpass.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | ENV_PASS=`python3 /passencode.py` 4 | sed -i /opt/alfresco/tomcat/shared/classes/alfresco-global.properties -e "s/alfresco_user_store\.adminpassword=.*/alfresco_user_store\.adminpassword=$ENV_PASS/g" 5 | 6 | -------------------------------------------------------------------------------- /nginx-alfresco-80/.env: -------------------------------------------------------------------------------- 1 | HOSTNAME=ubuntu-N550RN 2 | -------------------------------------------------------------------------------- /nginx-alfresco-80/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | nginx: 4 | image: nginx 5 | hostname: ${HOSTNAME} 6 | volumes: 7 | - "./nginx/alfresco.conf:/etc/nginx/conf.d/alfresco.conf:ro" 8 | ports: 9 | - "80:80" 10 | depends_on: 11 | - alfresco 12 | alfresco: 13 | image: "pdubois/docker-alfresco:master" 14 | environment: 15 | - INITIAL_PASS=admun 16 | -------------------------------------------------------------------------------- /nginx-alfresco-80/nginx/alfresco.conf: -------------------------------------------------------------------------------- 1 | upstream alfresco_server { 2 | server alfresco:8080; 3 | } 4 | 5 | server { 6 | client_max_body_size 3G; 7 | listen 80; 8 | server_name $HOSTNAME; 9 | #root /dev/null 10 | 11 | rewrite ^/$ /share; 12 | location / { 13 | proxy_pass http://alfresco_server; 14 | proxy_set_header Host $http_host; 15 | proxy_set_header X-Real-IP $remote_addr; 16 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 17 | proxy_set_header X-Forwarded-Host $http_host; 18 | proxy_set_header X-Forwarded-Server $host; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /passencode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import hashlib 4 | import os 5 | passwd = os.getenv("INITIAL_PASS") 6 | encrypted = hashlib.new('md4', passwd.encode('utf-16le')).hexdigest() 7 | print (encrypted) 8 | 9 | 10 | -------------------------------------------------------------------------------- /protectnodes.amp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdubois/docker-alfresco/63e9387ed54cf8a56a7023a45c5fed64796d2647/protectnodes.amp -------------------------------------------------------------------------------- /setenv.sh: -------------------------------------------------------------------------------- 1 | # Load Tomcat Native Library 2 | LD_LIBRARY_PATH=/opt/alfresco/common/lib:$LD_LIBRARY_PATH 3 | 4 | JAVA_HOME=/opt/alfresco/java 5 | JRE_HOME=$JAVA_HOME 6 | JAVA_OPTS="-XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Djava.awt.headless=true -Dalfresco.home=/opt/alfresco -XX:ReservedCodeCacheSize=128m $JAVA_OPTS " 7 | # remove default memory settings 8 | JAVA_OPTS=`echo $JAVA_OPTS | sed 's/-Xmx[^ ]* //g' | sed 's/-Xms[^ ]* //g'` 9 | export JAVA_OPTS 10 | JAVA_OPTS="-Xms2048M -Xmx2048M $JAVA_OPTS " # java-memory-settings 11 | export JAVA_HOME 12 | if [ "$XMX" ]; then 13 | JAVA_OPTS=`echo $JAVA_OPTS | sed 's/-Xmx[^ ]* //g'` 14 | JAVA_OPTS="-Xmx"$XMX"M $JAVA_OPTS " # max heap java-memory-settings 15 | export JAVA_OPTS 16 | fi 17 | if [ "$XMS" ]; then 18 | JAVA_OPTS=`echo $JAVA_OPTS | sed 's/-Xms[^ ]* //g'` 19 | JAVA_OPTS="-Xms"$XMS"M $JAVA_OPTS " # starting heap java-memory-settings 20 | export JAVA_OPTS 21 | fi 22 | 23 | export JRE_HOME 24 | export JAVA_OPTS 25 | export LD_LIBRARY_PATH 26 | 27 | -------------------------------------------------------------------------------- /startcontainerexample.sh: -------------------------------------------------------------------------------- 1 | docker run -d -e INITIAL_PASS=password \ 2 | -e ALF_1=mail.host=smtp.gmail.com \ 3 | -e ALF_2=mail.port=587 \ 4 | -e ALF_3=mail.username=user@gmail.com \ 5 | -e ALF_4=mail.password=mailpass \ 6 | -e ALF_5=mail.protocol=smtp \ 7 | -e ALF_6=mail.encoding=UTF-8 \ 8 | -e ALF_7=mail.from.default=somemail@gmail.com \ 9 | -e ALF_8=mail.smtp.starttls.enable=true \ 10 | -e ALF_9=mail.smtp.auth=true \ 11 | -e ALF_10=mail.smtp.debug=false \ 12 | -e ALF_11=mail.testmessage.send=false \ 13 | -e ALF_12=mail.testmessage.to=somemail@gmail.com \ 14 | -e ALF_13=mail.testmessage.subject="Outbound SMTP" \ 15 | -e ALF_14=mail.testmessage.text="The Outbound SMTP email subsystem is working." \ 16 | -e ALF_15=mail.smtp.socketFactory.port=587 \ 17 | -e ALF_16=mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory \ 18 | -e ALF_17=mail.smtp.socketFactory.fallback=false \ 19 | -e ALF_18=notification.email.siteinvite=true \ 20 | -e ALF_19=share.context=share \ 21 | -e ALF_20=share.host=localhost \ 22 | -e ALF_21=share.port=8080 \ 23 | -e ALF_22=share.protocol=http \ 24 | -t -i -p 8080:8080 pdubois/docker-alfresco:v5.1.g 25 | -------------------------------------------------------------------------------- /tuneglobal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # setting values for all the "-e ALF_xxx=..." parameters provided at startup 3 | set -e 4 | for thing in `env` 5 | do 6 | if [[ $thing == ALF_* ]]; then 7 | # replace the "\075" when equal is escaped (see tutum) 8 | thingreplaced=`echo -e $thing` 9 | # another possibility to escape with tutul is to use .EQ. 10 | string_to_replace_with="=" 11 | result_string="${thingreplaced/.EQ./$string_to_replace_with}" 12 | thingreplaced=$result_string 13 | echo $thingreplaced 14 | # getting the value of the parameter 15 | val=`echo -e "$thingreplaced" | awk -F "=" '{print $1}'` 16 | echo "val:$val" 17 | # getting the name value of the configuration variable passed as parameter 18 | name=`echo -e "${!val}" | awk -F "\.EQ\.|=" '{print $1}'` 19 | echo "name:$name" 20 | varvalue=`echo ${!val#*'.EQ.'}` 21 | echo "varvalue:$varvalue" 22 | # if varvalue starts with TUTUM then it is considered as a tutum variable 23 | if [[ $varvalue == TUTUM* ]]; then 24 | varvalue=`echo -e "${!varvalue}"` 25 | echo "varvalue tutum:$varvalue" 26 | fi 27 | # test if varvalue already configured in alfresco-global.properties 28 | if grep -q ^$name= /opt/alfresco/tomcat/shared/classes/alfresco-global.properties 29 | then 30 | sed -i "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" -e "s/$name=.*/$name=$varvalue/g" 31 | else 32 | echo "$name=\n$varvalue" >> "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" 33 | fi 34 | fi 35 | done 36 | 37 | -------------------------------------------------------------------------------- /tunerepo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | # do not keep orphan content 4 | echo "system.content.orphanProtectDays=1" >> "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" 5 | 6 | # configure trashcan cleaner 7 | echo "trashcan.cleaner.protected.day=1" >> "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" 8 | echo "trashcan.cleaner.cron=0 0 4 * * ?" >> "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" 9 | echo "trashcan.cleaner.pagelen=5" >> "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" 10 | # disabling deleted content being copied to ContentStore.deleted 11 | mv /disable-delbackup-context.xml /opt/alfresco/tomcat/shared/classes/alfresco/extension 12 | 13 | 14 | -------------------------------------------------------------------------------- /tunesolr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #/opt/alfresco/solr4/workspace-SpacesStore/conf/solrcore.properties 3 | #/opt/alfresco/solr4/archive-SpacesStore/conf/solrcore.properties 4 | # alfresco.cron=0/15 * * * * ? * 5 | # slowing down solr tracking 6 | set -e 7 | sed -i /opt/alfresco/solr4/workspace-SpacesStore/conf/solrcore.properties -e "s/alfresco\.cron=.*/alfresco\.cron=0\/30 \* \* \* \* \? \*/g" 8 | sed -i /opt/alfresco/solr4/archive-SpacesStore/conf/solrcore.properties -e "s/alfresco\.cron=.*/alfresco\.cron=0\/30 \* \* \* \* \? \*/g" 9 | 10 | # Disabling solr security 11 | # alfresco.secureComms=none 12 | sed -i /opt/alfresco/solr4/workspace-SpacesStore/conf/solrcore.properties -e "s/alfresco\.secureComms=.*/alfresco\.secureComms=none/g" 13 | sed -i /opt/alfresco/solr4/archive-SpacesStore/conf/solrcore.properties -e "s/alfresco\.secureComms=.*/alfresco\.secureComms=none/g" 14 | 15 | 16 | 17 | 18 | # Disable solr4 backup 19 | echo "solr.backup.alfresco.cronExpression=0 0 0 1 1 ? 2200" >> "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" 20 | echo "solr.backup.archive.cronExpression=0 0 0 1 1 ? 2200" >> "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" 21 | 22 | # Disable solr security alfresco side 23 | echo "solr.secureComms=none" >> "/opt/alfresco/tomcat/shared/classes/alfresco-global.properties" 24 | 25 | if [ ! -z "$SOLR_TRACKING" ]; then 26 | # enable.alfresco.tracking=true | false 27 | sed -i /opt/alfresco/solr4/workspace-SpacesStore/conf/solrcore.properties -e "s/enable.alfresco.tracking=.*/enable.alfresco.tracking=$SOLR_TRACKING/g" 28 | sed -i /opt/alfresco/solr4/archive-SpacesStore/conf/solrcore.properties -e "s/enable.alfresco.tracking=.*/enable.alfresco.tracking=$SOLR_TRACKING/g" 29 | fi 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /waitready.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | until [ "`curl --silent --show-error --connect-timeout 1 -I http://localhost:8080/share | grep 'Found'`" != "" ]; 4 | do 5 | echo --- sleeping for 10 seconds 6 | sleep 10 7 | done 8 | 9 | echo Tomcat is ready! 10 | -------------------------------------------------------------------------------- /yml-with-volumes/.env: -------------------------------------------------------------------------------- 1 | INDEX_AND_DATA=/home/ubuntu/alf_data 2 | -------------------------------------------------------------------------------- /yml-with-volumes/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | alfresco: 4 | image: "pdubois/docker-alfresco:master" 5 | volumes: 6 | - ${INDEX_AND_DATA}:/opt/alfresco/alf_data 7 | ports: 8 | - "8443" 9 | environment: 10 | - INITIAL_PASS=admun 11 | 12 | 13 | --------------------------------------------------------------------------------