Skip to content

Commit

Permalink
Merge branch 'platform:master' into studio:master
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Jun 6, 2017
2 parents 15d2beb + 9003d96 commit 6536ad1
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 36 deletions.
1 change: 0 additions & 1 deletion .env
Expand Up @@ -5,7 +5,6 @@ COMPOSE_DIR=.

# You'll need to adjust this for Windows and XDB Linux systems: https://getcomposer.org/doc/03-cli.md#composer-home
COMPOSER_HOME=~/.composer
SYMFONY_ENV=prod
DATABASE_USER=ezp
DATABASE_PASSWORD=SetYourOwnPassword
DATABASE_NAME=ezp
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -30,6 +30,9 @@ branches:
- master
- /^\d.\d+$/

# Update Docker and Docker Compose
before_install: ./bin/.travis/trusty/update_docker.sh

before_script:
# Internal auth token dedicated to testing with travis+composer on ezsystems repos, not for reuse!
- echo "{\"github-oauth\":{\"github.com\":\"d0285ed5c8644f30547572ead2ed897431c1fc09\"}}" > auth.json
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Expand Up @@ -19,8 +19,8 @@ RUN mkdir -p web/var \
&& rm -Rf app/logs/* app/cache/*/* \
# Fix permissions for www-data
&& chown -R www-data:www-data app/cache app/logs web/var \
&& find app/cache app/logs web/var -type d | xargs chmod -R 775 \
&& find app/cache app/logs web/var -type f | xargs chmod -R 664 \
&& find app/cache app/logs web/var -type d -print0 | xargs -0 chmod -R 775 \
&& find app/cache app/logs web/var -type f -print0 | xargs -0 chmod -R 664 \
# Remove composer cache to avoid it taking space in image
&& rm -rf ~/.composer/*/* \
&& [ "$REMOVE_AUTH" = "1" ] && rm -f auth.json
Expand Down
21 changes: 11 additions & 10 deletions bin/.travis/trusty/update_docker.sh
@@ -1,19 +1,20 @@
#!/usr/bin/env sh

# Update package info and selectively update docker-engine (and keep old travis specific config file)
#disabled to save startup time as last travis image already have docker v1.12.0
#sudo apt-get update
#sudo apt-get --reinstall -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install docker-engine
#docker -v
docker -v
sudo apt-get update
sudo apt-get --reinstall -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install docker-engine
docker -v

# If we need to pin it to a given version:
# sudo apt-get --reinstall -y [...] install docker-engine=1.11.0-0~jessie
# http://apt.dockerproject.org/repo/dists/debian-jessie/main/binary-amd64/Packages


#DOCKER_COMPOSE_VERSION="1.8.0"
#echo "\nUpdating Docker Compose to ${DOCKER_COMPOSE_VERSION}"
#sudo rm -f /usr/local/bin/docker-compose
#curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
#chmod +x docker-compose
#sudo mv docker-compose /usr/local/bin
docker-compose -v
DOCKER_COMPOSE_VERSION="1.13.0"
echo "\nUpdating Docker Compose to ${DOCKER_COMPOSE_VERSION}"
sudo rm -f /usr/local/bin/docker-compose
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
chmod +x docker-compose
sudo mv docker-compose /usr/local/bin
22 changes: 22 additions & 0 deletions doc/docker-compose/Dockerfile-solr
@@ -0,0 +1,22 @@
FROM solr:6-alpine

# Copy solr config from the version used by eZ Platform
COPY vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/ /opt/solr/server/tmp

# Prepare config
RUN mkdir -p /opt/solr/server/ez/template \
&& cp -R /opt/solr/server/tmp/* /opt/solr/server/ez/template \
&& cp /opt/solr/server/solr/configsets/basic_configs/conf/currency.xml /opt/solr/server/ez/template \
&& cp /opt/solr/server/solr/configsets/basic_configs/conf/solrconfig.xml /opt/solr/server/ez/template \
&& cp /opt/solr/server/solr/configsets/basic_configs/conf/stopwords.txt /opt/solr/server/ez/template \
&& cp /opt/solr/server/solr/configsets/basic_configs/conf/synonyms.txt /opt/solr/server/ez/template \
&& cp /opt/solr/server/solr/configsets/basic_configs/conf/elevate.xml /opt/solr/server/ez/template \
&& cp /opt/solr/server/solr/solr.xml /opt/solr/server/ez \
&& sed -i.bak '/<updateRequestProcessorChain name="add-unknown-fields-to-the-schema">/,/<\/updateRequestProcessorChain>/d' /opt/solr/server/ez/template/solrconfig.xml \
&& sed -ie 's/${solr.autoSoftCommit.maxTime:-1}/${solr.autoSoftCommit.maxTime:100}/' /opt/solr/server/ez/template/solrconfig.xml

# Set our core config as home
ENV SOLR_HOME /opt/solr/server/ez

# Make sure core is created on startup
CMD ["solr-create", "-c", "collection1", "-d", "/opt/solr/server/ez/template"]
6 changes: 3 additions & 3 deletions doc/docker-compose/README.md
Expand Up @@ -10,7 +10,7 @@

## Overview

This setup requires Docker Compose 1.7 or higher, and Docker 1.10 or higher. Defaults are set in `.env`, and
This setup requires Docker Compose 1.9 or higher, and Docker 1.12 or higher. Defaults are set in `.env`, and
files to ignore are set in `.dockerignore`. By default `.env` specifies that production image is built and setup for use.
_**NB:** For this and other reasons all docker-compose commands **must** be executed from root of your project directory._

Expand Down Expand Up @@ -70,7 +70,7 @@ by default under the hood, which leads to much slower IO performance.*

From root of your projects clone of this distribution, [setup composer auth.json](#composer) and execute the following:
```sh
export COMPOSE_FILE=doc/docker-compose/base-dev.yml SYMFONY_ENV=dev
export COMPOSE_FILE=doc/docker-compose/base-dev.yml

# Optional: If you use Docker Machine with NFS, you'll need to specify where project is, & give composer a valid directory.
#export COMPOSE_DIR=/data/SOURCES/MYPROJECTS/ezplatform/doc/docker-compose COMPOSER_HOME=/tmp
Expand Down Expand Up @@ -176,7 +176,7 @@ docker-compose down -v

And if you have defined any environment variables you can unset them using:
```sh
unset COMPOSE_FILE SYMFONY_ENV COMPOSE_DIR COMPOSER_HOME
unset COMPOSE_FILE COMPOSE_DIR COMPOSER_HOME

# To unset blackfire variables
unset BLACKFIRE_SERVER_ID BLACKFIRE_SERVER_TOKEN
Expand Down
6 changes: 3 additions & 3 deletions doc/docker-compose/base-dev.yml
@@ -1,4 +1,4 @@
version: '2'
version: '2.1'
# Single server setup for dev

services:
Expand All @@ -10,7 +10,7 @@ services:
depends_on:
- db
environment:
- SYMFONY_ENV
- SYMFONY_ENV=${SYMFONY_ENV-dev}
- SYMFONY_DEBUG
- SYMFONY_HTTP_CACHE
- SYMFONY_HTTP_CACHE_CLASS
Expand All @@ -27,7 +27,7 @@ services:
ports:
- "8080:80"
environment:
- SYMFONY_ENV
- SYMFONY_ENV=${SYMFONY_ENV-dev}
- MAX_BODY_SIZE=20
- FASTCGI_PASS=app:9000
- TIMEOUT=190
Expand Down
6 changes: 3 additions & 3 deletions doc/docker-compose/base-prod.yml
@@ -1,4 +1,4 @@
version: '2'
version: '2.1'
# Simple single server setup for prod

services:
Expand All @@ -10,7 +10,7 @@ services:
depends_on:
- db
environment:
- SYMFONY_ENV
- SYMFONY_ENV=${SYMFONY_ENV-prod}
- SYMFONY_DEBUG
- SYMFONY_HTTP_CACHE
- SYMFONY_HTTP_CACHE_CLASS
Expand All @@ -27,7 +27,7 @@ services:
ports:
- "8080:80"
environment:
- SYMFONY_ENV
- SYMFONY_ENV=${SYMFONY_ENV-prod}
- MAX_BODY_SIZE=20
- FASTCGI_PASS=app:9000
- TIMEOUT=190
Expand Down
2 changes: 1 addition & 1 deletion doc/docker-compose/blackfire.yml
@@ -1,4 +1,4 @@
version: '2'
version: '2.1'
# Blackfire agent config, to be appended after base-prod or base-dev config.
# You'll need to export the two blackfire server variables before you can use this.

Expand Down
4 changes: 2 additions & 2 deletions doc/docker-compose/install.yml
Expand Up @@ -36,8 +36,8 @@ services:
php app/console ezplatform:install ${INSTALL_EZ_INSTALL_TYPE};
rm -Rf app/logs/* app/cache/*/*;
chown -R www-data:www-data app/cache app/logs web/var;
find app/cache app/logs web/var -type d | xargs chmod -R 775;
find app/cache app/logs web/var -type f | xargs chmod -R 664;
find app/cache app/logs web/var -type d -print0 | xargs -0 chmod -R 775;
find app/cache app/logs web/var -type f -print0 | xargs -0 chmod -R 664;
chown -R www-data:www-data app/config src;
echo 'Dumping database into doc/docker-compose/entrypoint/mysql/2_dump.sql for use by mysql on startup.';
mysqldump -u $$DATABASE_USER --password=$$DATABASE_PASSWORD -h $$DATABASE_HOST --add-drop-table --extended-insert --protocol=tcp $$DATABASE_NAME > doc/docker-compose/entrypoint/mysql/2_dump.sql"
2 changes: 1 addition & 1 deletion doc/docker-compose/redis.yml
@@ -1,4 +1,4 @@
version: '2'
version: '2.1'
# Redis config, to be appended after base-prod or base-dev, ..., but before selenium.yml

services:
Expand Down
2 changes: 1 addition & 1 deletion doc/docker-compose/selenium.yml
@@ -1,4 +1,4 @@
version: '2'
version: '2.1'
# Appends services to prod.yml, prod+dev, prod+redis, ..., always latests

services:
Expand Down
15 changes: 6 additions & 9 deletions doc/docker-compose/solr.yml
@@ -1,8 +1,6 @@
version: '2'
version: '2.1'
# Solr config, to be appended after base-prod or base-dev, ..., but before selenium.yml
#
# This service will migrate to use offical Solr image and use entrypoint once Solr bundle supports SOLR6+.
#
# NOTE: You'll need to manually reindex the solr index when booting this as we don't have entrypoint for solr yet.
# (Unless you use ezplatform:install command which indexes for you)

Expand All @@ -15,9 +13,8 @@ services:
- SOLR_DSN=http://solr:8983/solr

solr:
image: makuk66/docker-solr:4.10.4
volumes_from:
- app:ro
environment:
- EZ_SOLR_CONF="/var/www/vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr"
command: /bin/bash -c "cp -R $${EZ_SOLR_CONF}/* /opt/solr/example/solr/collection1/conf/ && /opt/solr/bin/solr start -f"
build:
context: ../../
dockerfile: doc/docker-compose/Dockerfile-solr
ports:
- "8983:8983"

0 comments on commit 6536ad1

Please sign in to comment.