Coder Social home page Coder Social logo

docker-alfresco's Introduction

docker-alfresco

Table of Contents

Introduction

Dockerfile to build an Alfresco container image.

Contributing

Here is how you can help:

  • Send a Pull Request with your awesome new features and bug fixes
  • Report Issues

Installation

Pull the image from the docker index.

docker pull gui81/alfresco:latest

or pull a particular version:

docker pull gui81/alfresco:201707

Alternatively, you can build the image yourself:

git clone https://github.com/gui81/docker-alfresco.git
cd docker-alfresco
docker build --tag="$USER/alfresco" .

Quick Start

Run the alfresco image with the name "alfresco".

docker run --name='alfresco' -it --rm -p 8080:8080 gui81/alfresco

NOTE: Please allow a few minutes for the application to start, especially if populating the database for the first time.

Go to http://localhost:8080/share or point to the ip of your docker server. On the Mac, if you are running docker-machine, then you can go to the ip reported by:

docker-machine ip [name of Docker VM]

The default username and password are:

  • username: admin
  • password: admin

Alfresco should now be up and running. The following is an example that would mount the appropriate volume, connect to a remote PostgreSQL database, and use an external LDAP server for authentication:

docker run --name='alfresco' -it --rm -p 445:445 -p 7070:7070 -p 8080:8080 \
    -v '/host/alfresco/content:/content' \
    -v '/host/alfresco/data:/alfresco/alf_data' \
    -e 'CONTENT_STORE=/content' \
    -e 'LDAP_ENABLED=true' \
    -e 'LDAP_AUTH_USERNAMEFORMAT=uid=%s,cn=users,cn=accounts,dc=example,dc=com' \
    -e 'LDAP_URL=ldap://ipa.example.com:389' \
    -e 'LDAP_DEFAULT_ADMINS=admin' \
    -e 'LDAP_SECURITY_PRINCIPAL=uid=admin,cn=users,cn=accounts,dc=example,dc=com' \
    -e 'LDAP_SECURITY_CREDENTIALS=password' \
    -e 'LDAP_GROUP_SEARCHBASE=cn=groups,cn=accounts,dc=example,dc=com' \
    -e 'LDAP_USER_SEARCHBASE=cn=users,cn=accounts,dc=example,dc=com' \
    -e 'DB_KIND=postgresql' \
    -e 'DB_HOST=db_server.example.com' \
    -e 'DB_USERNAME=alfresco' \
    -e 'DB_PASSWORD=alfresco' \
    -e 'DB_NAME=alfresco' \
    gui81/alfresco

If you want to use this image in production, then please read on.

Configuration

Datastore

In production, you will want to make sure to specify and mount the CONTENT_STORE and /alfresco/alf_data directories to persist this data. Example:

  • /content
  • /alfresco/alf_data

Volumes can be mounted by passing the '-v' option to the docker run command. The following is an example:

docker run --name alfresco -it --rm -v /host/alfresco/content:/content -v /host/alfresco/data:/alfresco/alf_data

Database

If the DB_HOST environment variable is not set, or set to localhost, then the image will use the internal PostgreSQL server.

PostgreSQL is the default, but MySQL/MariaDB is also supported. If you are using an existing database installation, then make sure to create the database and a user:

CREATE ROLE alfresco WITH LOGIN PASSWORD 'alfresco';
CREATE DATABASE alfresco;
GRANT ALL PRIVILEGES ON DATABASE alfresco TO alfresco;

Options

Below is the complete list of currently available parameters that can be set using environment variables.

  • ALFRESCO_HOSTNAME: hostname of the Alfresco server; default = localhost
  • ALFRESCO_PORT: port for afresco to listen to; default = 8080 if protocol is http or 8443 if protocol is https
  • ALFRESCO_PROTOCOL: protocol used by alfresco to generate links; default = http
  • AMP_DIR_ALFRESCO: directory containing AMP files (modules) for alfresco.war (bind mount as volume)
  • AMP_DIR_SHARE: directory containing AMP files (modules) for share.war (bind mount as volume)
  • CIFS_ENABLED: whether or not to enable CIFS; default = true
  • CIFS_SERVER_NAME: hostname of the CIFS server; default = localhost
  • CIFS_DOMAIN: domain of the CIFS server; default = WORKGROUP
  • CONTENT_STORE: where content is stored; default = /content
  • DB_CONN_PARAMS: database connection parameters; for MySQL, default = ?useSSL=false, otherwise empty
  • DB_HOST: host of the database server; default = localhost
  • DB_KIND: postgresql or mysql; default = postgresql
  • DB_NAME: name of the database to connect to; default = alfresco
  • DB_PASSWORD: password to use when connecting to the database; default = admin
  • DB_USERNAME: username to use when connecting to the database; default = alfresco
  • FTP_PORT: port of the database server; default = 5432
  • LDAP_ENABLED: whether or not to enable LDAP; default = false
  • LDAP_KIND: ldap (e.g. for OpenLDAP) or ldap-ad (Active Directory); default = ldap
  • LDAP_AUTH_USERNAMEFORMAT: Specifies how to map the user identifier entered by the user to that passed through to LDAP. Could be empty to enable "search and bind" method. default = uid=%s,cn=users,cn=accounts,dc=example,dc=com
  • LDAP_URL: URL of LDAP server; default = ldap://ldap.example.com:389
  • LDAP_DEFAULT_ADMINS: comma separated list of admin names in ldap; default = admin
  • LDAP_SECURITY_PRINCIPAL: default = uid=admin,cn=users,cn=accounts,dc=example,dc=com
  • LDAP_SECURITY_CREDENTIALS: default = password
  • LDAP_GROUP_SEARCHBASE: default = cn=groups,cn=accounts,dc=example,dc=com
  • LDAP_USER_SEARCHBASE: default = cn=users,cn=accounts,dc=example,dc=com
  • LDAP_USER_ATTRIBUTENAME: The attribute name on people objects found in LDAP to use as the uid in Alfresco (commonly uid in OpenLDAP or sAMAccountName in Active Directory); default = uid
  • LDAP_GROUP_MEMBER_ATTRIBUTENAME: The attribute in LDAP on group objects that defines the DN for its members (commonly memberUid in OpenLDAP or member in Active Directory); default = memberUid
  • MAIL_HOST: hostname or IP where email should be sent; default = localhost
  • MAIL_PORT: default = 25
  • MAIL_USERNAME: username to connect to the smtp server
  • MAIL_PASSWORD: password to connect to the smtp server
  • MAIL_FROM_DEFAULT: what is in the from field; default = [email protected]
  • MAIL_PROTOCOL: smtp or smtps; default = smtp
  • MAIL_SMTP_AUTH: is authentication required or not; default = false
  • MAIL_SMTP_STARTTLS_ENABLE: use starttls or not; default = false
  • MAIL_SMTPS_AUTH: is authentication required or not; default = false
  • MAIL_SMTPS_STARTTLS_ENABLE: use starttls or not; default = false
  • NFS_ENABLED: whether or not to enable NFS; default = true
  • SHARE_HOSTNAME: hostname of the share server; default = localhost
  • SHARE_PORT: port for share to listen to; default = 8080 if protocol is http or 8443 if protocol is https
  • SHARE_PROTOCOL: protocol use by share to generate links; default = http
  • SYSTEM_SERVERMODE: the server running mode for you system; default = PRODUCTION
  • TOMCAT_CSRF_ENABLED: Disable the tomcat CSRF policy; default = false

Upgrading

TODO: I might be able to add some options that aid in upgrading. For now though, backup, backup, backup, and then follow this guide:

References

docker-alfresco's People

Contributors

gui81 avatar jri-sp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-alfresco's Issues

Document preview

I have tried a thousand ways without luck. We did not make document visualization work.
We have seen that a library is missing, we have installed it, we get libreoffice started but the problem persists. Does anyone else have this problem?

Alfresco error when using data volume for "/alfresco/alf_data"

Hi.
When I run this command to start a brand new alfresco :
docker run --name alfresco -it --rm -v /host/alfresco/content:/content -v /host/alfresco/data:/alfresco/alf_data gui81/alfresco

Alfresco is able to start, but I can't log in and I get the following error:
Your authentication details have not been recognized or Alfresco may not be available at this time.

In the log file "/alfresco/tomcat/logs/catalina.out" I get this error (and many others):
SEVERE: Failed to load keystore type JCEKS with path /alfresco/alf_data/keystore/ssl.keystore due to /alfresco/alf_data/keystore/ssl.keystore (No such file or directory)

The data volume mounted from the docker host is empty. So, the directory /alfresco/alf_data is empty too: no keystore to load.

During the installation process triggered by the Dockerfile, alfresco put several mandatory stuffs into /alfresco/alf_data.
Mounting an empty data volume in place of the /alfresco/alf_data make alfresco unable to work properly.
Can we save the alf_data at the end of the dockerfile and restore it (if it doesn't exist) during the init.sh ? So the data volume would be populated using the mandatory data at the first run of the container ?

Regards.

Unable to login using external data volume

My docker-compose.yml looks as follows:

version: '2'
services:
  alfresco:
    image: gui81/alfresco
    environment:
      CONTENT_STORE: /home/alfresco/content:/content
      DB_HOST: mysql
      DB_KIND: mysql
      DB_NAME: alfresco
      DB_PASSWORD: mypassword
      DB_USERNAME: root
      #LDAP_AUTH_USERNAMEFORMAT: uid=%s,cn=users,cn=accounts,dc=example,dc=com
      #LDAP_DEFAULT_ADMINS: admin
      #LDAP_ENABLED: true
      #LDAP_GROUP_SEARCHBASE: cn=groups,cn=accounts,dc=example,dc=com
      #LDAP_SECURITY_CREDENTIALS: secret
      #LDAP_SECURITY_PRINCIPAL: uid=admin,cn=users,cn=accounts,dc=example,dc=com
      #LDAP_URL: ldap://ipa.example.com:389
      #LDAP_USER_SEARCHBASE: cn=users,cn=accounts,dc=example,dc=com
    links:
      - mysql:mysql
    depends_on:
      - mysql
    ports:
      - 8080:8080
    volumes:
      - /home/alfresco/alf_data:/alfresco/alf_data
      - /home/alfresco/tomcat/logs:/alfresco/tomcat/logs
      - /home/alfresco/content:/content

  mysql:
    environment:
      MYSQL_ROOT_PASSWORD: mypassword
      MYSQL_DATABASE: alfresco
    image: mysql
    volumes:
      - /home/alfresco/mysqldata/mysql:/var/lib/mysql
    restart: always

Not able to login to Alfresco after reaching to http://my_ip:8080/share/page using following credentials:

username: admin
password: admin

If I only use container volume, then everything works fine i.e

volumes:
      - /alfresco/alf_data
      - /alfresco/tomcat/logs
      - /content

Disable CSRF policy

Hi.
I need to disable CSRF policy in /alfresco/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml file.
It is not possible to do that with your current container.
If you don't mind, I plane to fork your project, make some change and perform a nice pull request...
(https://github.com/ATIH/docker-alfresco)

Regards.

Set memory size

Hello!

As you can skip this test? Docker is running in a virtual machine.

1.95 GB of RAM is not enough to run Alfresco for test or production purposes. Alfresco might not work correctly and if it does, will not perform well. Upgrade the server to have at least 2.0 GB of RAM, and optimally 4.0 GB of RAM. ERROR: Service 'alfresco' failed to build: The command '/bin/sh -c /tmp/install_alfresco.sh &> /dev/null && rm -f /tmp/install_alfresco.sh &> /dev/null' returned a non-zero code: 1

Connection failed at second start

I'm using the image with mysql.

The first time I start the container, it works.
Then I stopped the containers and restart, I can't connect to alfresco using the UI (login failed).
If I delete the volume and restart, it works.

I saw this problem on a mac and in a vagrant box running ubuntu.
But it seems to work on linux.

Any idea ?
Thanks

Below my docker-compose :

alfresco-mysql:
image: mysql:5.7.20
volumes:
- ~/volumes/alfresco/mysql/:/var/lib/mysql/
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=alfresco
- MYSQL_PASSWORD=alfresco
- MYSQL_DATABASE=alfresco
ports:
- 3306:3306
command: mysqld --lower_case_table_names=1 --skip-ssl --character_set_server=utf8 --explicit_defaults_for_timestamp

alfresco:
    image: "gui81/alfresco:201707"
    volumes:
      - ~/volumes/alfresco/alf_data:/alfresco/alf_data
      #- ~/volumes/alfresco/content:/content
    environment:
      - DB_KIND=mysql
      - DB_HOST=alfresco-mysql
      - DB_USERNAME=alfresco
      - DB_PASSWORD=alfresco
      - DB_NAME=alfresco
      #- CONTENT_STORE=/content
    ports:
      - "7080:8080"
      - "8443:8443"

cfg_replace_option parameters should be quoted

Cannot setup instance having space in LDAP_SECURITY_PRINCIPAL environment variable.
The problem is fixed double quoting the second parameter while calling cfg_replace_option in init.sh:

cfg_replace_option ldap.synchronization.java.naming.security.principal "$LDAP_SECURITY_PRINCIPAL" $LDAP_CONFIG_FILE

The same should be done for other parameters too.

When mounting data volumes (-v) keystore and PostgreSQL data missing

When using the -v switch for the docker run command on a freshly pulled image Alfresco is not booting up properly as required data (such as the PostgreSQL data and keystore files are missing). There should be some kind of initialization which provides these data in case they are not existent.

Docker Not Building

Hi am new to docker. When i try to build an image, i keep getting the below error. Please assist.

ERROR: Service 'alfresco' failed to build: The command '/bin/sh -c /tmp/install_alfresco.sh && rm -rf /tmp/* /var/tmp/*' returned a non-zero code: 2

ERROR: Service 'alfresco' failed to build

docker-compose up
Building alfresco
Step 1/22 : FROM centos:centos7
 ---> 3bee3060bfc8
Step 2/22 : MAINTAINER Lucas Johnson <[email protected]>
 ---> Using cache
 ---> 4edff14dcb69
Step 3/22 : RUN yum update -y &&     yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm &&     yum install -y                    cups-libs                    dbus-glib                    fontconfig                    hostname                    libICE                    libSM                    libXext                    libXinerama                    libXrender                    supervisor                    wget                    patch &&     yum clean all
 ---> Using cache
 ---> 283f63da1d79
Step 4/22 : COPY assets/install_java.sh /tmp/install_java.sh
 ---> Using cache
 ---> 7ea77c7ec23c
Step 5/22 : RUN /tmp/install_java.sh &&     rm -f /tmp/install_java.sh
 ---> Running in 0bf85ec38c22
--2017-06-16 05:28:55--  http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm
Resolving download.oracle.com (download.oracle.com)... 200.188.128.145, 200.188.128.139
Connecting to download.oracle.com (download.oracle.com)|200.188.128.145|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm [following]
--2017-06-16 05:28:56--  https://edelivery.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm
Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.72.37.222, 2600:1404:a:399::2d3e, 2600:1404:a:388::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.72.37.222|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm?AuthParam=1497591057_30945fb5e8f889c2c40b3636d5f1018a [following]
--2017-06-16 05:28:56--  http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm?AuthParam=1497591057_30945fb5e8f889c2c40b3636d5f1018a
Connecting to download.oracle.com (download.oracle.com)|200.188.128.145|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-06-16 05:28:57 ERROR 404: Not Found.

ERROR: Service 'alfresco' failed to build: The command '/bin/sh -c /tmp/install_java.sh &&     rm -f /tmp/install_java.sh' returned a non-zero code: 8


Parametrise alfresco installer URL

You could paramterise alfresco installer URL with --build-arg flag and ARG dockerfile instruction. That way you could build and tag images for different alfresco versions without changes in the source code.
Just an idea.

Fix CSRF default value

Default value is true but doc says false:

"TOMCAT_CSRF_ENABLED: Disable the tomcat CSRF policy; default = false"

init.sh:

TOMCAT_CSRF_ENABLED=${TOMCAT_CSRF_ENABLED:-true}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.