Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 46 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,6 @@ You should review volumes, configuration, modules & tuning parameters before usi
* [alfresco-search-services 1.2.0](https://github.com/Alfresco/SearchServices/blob/master/packaging/src/docker/Dockerfile)
* [content-app master:latest](https://hub.docker.com/r/alfresco/alfresco-content-app/)

## Volumes

A directory named `volumes` is located in the root folder to store configuration, data and log files.

```bash
$ tree volumes
volumes
├── config
│   ├── alfresco-global.properties
│   ├── ext-share-config-custom.xml
│   ├── nginx.conf
│   └── nginx.htpasswd
├── data
│   ├── alf-repo-data
│   ├── postgres-data
│   └── solr-data
└── logs
├── alfresco
├── nginx
├── postgres
└── share
```

**Configuration** files are available at `config` folder:

* `alfresco-global.properties` for Repository
* `ext-share-config-custom.xml` for Share
* `nginx.conf` for HTTP Proxy
* `nginx.htpasswd` for Basic Auth credentials to access SOLR Web Console

**Data** wil be persisted automatically in `data` folder. Once launched, Docker will create three subfolders for following services:

* `alf-repo-data` for Content Store
* `postgres-data` for Database
* `solr-data` for Indexes

>> For Linux hosts, set `solr-data` folder permissions to user with UID 1001, as `alfresco-search-services` is using an container user named `solr` with UID 1001.

**Logs** folder includes log files for:

* `alfresco` contains Tomcat repository logs
* `nginx` contains HTTP Proxy logs
* `postgres` contains database logs
* `share` contains Tomcat share logs

## Tuning options

Memory resources for the containers can be changed in `.env` file.
Expand Down Expand Up @@ -97,7 +52,7 @@ PG_MAX_PARALLEL_WORKERS=1

## SOLR Considerations

Alfresco SOLR API has been protected to be accessed from outside Docker network. You can enable this URLs removing following lines at [nginx.conf](https://github.com/keensoft/docker-alfresco/blob/master/volumes/config/nginx.conf)
Alfresco SOLR API has been protected to be accessed from outside Docker network. You can enable this URLs removing following lines at `nginx-config-volume`/conf.d/alfresco.conf (see [Volumes setup](#volumes)) and restarting Nginx.

```
# Protect access to SOLR APIs
Expand All @@ -110,7 +65,49 @@ Alfresco SOLR API has been protected to be accessed from outside Docker network.
location ~ ^(/.*/-default-/proxy/alfresco/api/.*)$ {return 403;}
```

SOLR Web Console (http://localhost/solr) access has been protected with Basic Auth. Default user/password is `admin/admin`, but it can be customised modifying the content of the file [nginx.htpasswd](https://github.com/keensoft/docker-alfresco/blob/master/volumes/config/nginx.htpasswd)
SOLR Web Console (http://localhost/solr) access has been protected with Basic Auth. Default user/password is `admin/admin`, but it can be customised modifying the content of the file `nginx-config-volume`/conf.d/nginx.htpasswd (see [Volumes setup](#volumes)) and restarting Nginx.

## <a name="volumes"></a>Volumes setup
This setup uses named volumes rather than bind/host volumes because they are easier to manage and more compatible in different platforms.

The volumes used are the next ones (DON'T pre-create volumes with `docker volume create` before first execution or container won't populate these ones with container original content):

- alf-repo-data-volume
- alf-logs-volume
- alf-shared-volume
- share-logs-volume
- share-shared-volumes
- solr-data-volume
- solr-log-volume
- pg-data-volume
- pg-log-volume
- nginx-config-volume
- nginx-log-volume

To access the contents of these volumes execute this (from [gdiepen/volume-sharer](https://github.com/gdiepen/volume-sharer)):
```bash
(Linux)
docker run --name volume-sharer \
--rm \
-d \
-v /var/lib/docker/volumes:/docker_volumes \
-p 139:139 \
-p 445:445 \
-v /var/run/docker.sock:/var/run/docker.sock \
gdiepen/volume-sharer

(Windows)
docker run --name volume-sharer \
--rm \
-d \
-v /var/lib/docker/volumes:/docker_volumes \
-p 139:139 \
-p 445:445 \
--net host
-v /var/run/docker.sock:/var/run/docker.sock \
gdiepen/volume-sharer
```
You can access (and modify) the content of these volumes through `smb://127.0.0.1:1139/` (linux) or `\\\10.0.7.75.2` (Windows)

# How to use this composition

Expand All @@ -137,7 +134,7 @@ You can view the system logs by issuing the following.
$ docker-compose logs -f
```

Logs for every service are also available at `volumes/logs` folder.
Logs for every service are also available in correspondent log volume.

## Access

Expand Down Expand Up @@ -172,7 +169,7 @@ After you `rebuild` the image, they will be available within the Alfresco instan

### Adding configuration to repository

You can set additional properties modifying default files available at `volumes/config` folder.
You can set additional properties modifying default files available at `alf-shared-volume`/classes/ folder.

### Configuration tips

Expand Down
4 changes: 3 additions & 1 deletion alfresco/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ RUN set -x \
&& mv /tmp/aos/alfresco-aos-module-1.2.0.amp amps \
&& mv /tmp/aos/aos-module-license.txt licenses \
&& mv /tmp/aos/_vti_bin.war $TOMCAT_DIR/webapps \
&& rm -rf /tmp/aos alfresco-aos-module-distributionzip-1.2.0.zip
&& rm -rf /tmp/aos alfresco-aos-module-distributionzip-1.2.0.zip

COPY alfresco-global.properties $TOMCAT_DIR/shared/classes/alfresco-global.properties
46 changes: 33 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: "3"
services:
alfresco:
build: ./alfresco
container_name: alfresco-alf
depends_on:
- db
environment:
Expand All @@ -22,28 +23,30 @@ services:
-Xmx${ALFRESCO_XMX} -Xms${ALFRESCO_XMS}
'
volumes:
- ./volumes/data/alf-repo-data:/usr/local/tomcat/alf_data
- ./volumes/logs/alfresco:/usr/local/tomcat/logs
- ./volumes/config/alfresco-global.properties:/usr/local/tomcat/shared/classes/alfresco-global.properties
- alf-repo-data-volume:/usr/local/tomcat/alf_data
- alf-logs-volume:/usr/local/tomcat/logs
- alf-shared-volume:/usr/local/tomcat/shared
networks:
- internal

share:
build: ./share
container_name: alfresco-share
depends_on:
- alfresco
environment:
- REPO_HOST=alfresco
- REPO_PORT=8080
- "CATALINA_OPTS=-XX:+UseG1GC -XX:+UseStringDeduplication -Xms${SHARE_XMS} -Xmx${SHARE_XMX}"
volumes:
- ./volumes/logs/share:/usr/local/tomcat/logs
- ./volumes/config/ext-share-config-custom.xml:/usr/local/tomcat/shared/classes/alfresco/web-extension/ext-share-config-custom.xml
- share-logs-volume:/usr/local/tomcat/logs
- share-shared-volumes:/usr/local/tomcat/shared
networks:
- internal

solr6:
image: alfresco/alfresco-search-services:1.2.0
container_name: alfresco-solr6
depends_on:
- alfresco
environment:
Expand All @@ -55,13 +58,14 @@ services:
- SOLR_JAVA_MEM=-Xms${SOLR_XMS} -Xmx${SOLR_XMX}
# Set permissions for user with uid 1000 ('isadm' in host, 'solr' in container)
volumes:
- ./volumes/data/solr-data:/opt/alfresco-search-services/data
# Logs directory cannot be exposed as volume as it includes also configuration inside (log4j.properties)
- solr-data-volume:/opt/alfresco-search-services/data
- solr-log-volume:/opt/alfresco-search-services/logs
networks:
- internal

content-app:
image: alfresco/alfresco-content-app:master-latest
container_name: alfresco-aca
depends_on:
- alfresco
environment:
Expand All @@ -71,6 +75,7 @@ services:

db:
image: postgres:10
container_name: alfresco-postgres
environment:
- POSTGRES_USER=alfresco
- POSTGRES_PASSWORD=alfresco
Expand All @@ -96,23 +101,38 @@ services:
-c log_min_messages=LOG
-c log_directory=/var/log/postgresql"
volumes:
- ./volumes/data/postgres-data:/var/lib/postgresql/data
- ./volumes/logs/postgres:/var/log/postgresql
- pg-data-volume:/var/lib/postgresql/data
- pg-log-volume:/var/log/postgresql
networks:
- internal

proxy:
image: nginx:stable-alpine
build: ./nginx
container_name: alfresco-nginx
depends_on:
- content-app
- share
volumes:
- ./volumes/config:/etc/nginx/conf.d
- ./volumes/logs/nginx:/var/log/nginx
- nginx-config-volume:/etc/nginx
- nginx-log-volume:/var/log/nginx
networks:
- internal
ports:
- 80:80

networks:
internal:
internal:


volumes:
alf-repo-data-volume:
alf-logs-volume:
alf-shared-volume:
share-logs-volume:
share-shared-volumes:
solr-data-volume:
solr-log-volume:
pg-data-volume:
pg-log-volume:
nginx-config-volume:
nginx-log-volume:
9 changes: 9 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nginx:stable-alpine

RUN rm -f /etc/nginx/conf.d/*
RUN rm -f /var/log/nginx/*

COPY nginx.conf /etc/nginx/conf.d/alfresco.conf
COPY nginx.htpasswd /etc/nginx/conf.d/nginx.htpasswd


File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion share/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ COPY modules/amps_share $TOMCAT_DIR/amps_share
COPY modules/jars $TOMCAT_DIR/webapps/share/WEB-INF/lib

RUN java -jar $TOMCAT_DIR/alfresco-mmt/alfresco-mmt*.jar install \
$TOMCAT_DIR/amps_share $TOMCAT_DIR/webapps/share -directory -nobackup -force
$TOMCAT_DIR/amps_share $TOMCAT_DIR/webapps/share -directory -nobackup -force

COPY ext-share-config-custom.xml $TOMCAT_DIR/shared/classes/alfresco/web-extension/ext-share-config-custom.xml