Skip to content

Commit

Permalink
arrange volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Feb 28, 2020
1 parent 08384d2 commit d41268e
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 92 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Expand Up @@ -3,7 +3,6 @@
.settings
/nodes_modules
/vendor
/volumes
/docker-compose.*
/Dockerfile
/.env
Expand Down
3 changes: 0 additions & 3 deletions .env
Expand Up @@ -56,9 +56,6 @@ MYSQL_MAX_ALLOWED_PACKET=16M
# PhpMyAdmin port
PHPMYADMIN_PORT=8089

# Mount local volumes
PHRASEANET_VOLUMES_DIR=./volumes

# Xdebug
XDEBUG_ENABLED=1
XDEBUG_PROFILER_ENABLED=0
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -71,5 +71,3 @@ playbook.retry
npm-debug.log

/Phrasea_datas

/volumes
13 changes: 7 additions & 6 deletions Dockerfile
Expand Up @@ -77,23 +77,24 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
nodejs \
yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists
&& rm -rf /var/lib/apt/lists \
&& mkdir -p /var/alchemy/Phraseanet \
&& chown -R app:app /var/alchemy

WORKDIR /var/alchemy/Phraseanet

USER app

# Warm up composer cache for faster builds
COPY docker/caching/composer.* ./
RUN composer install --prefer-dist --no-dev --no-progress --no-suggest --classmap-authoritative --no-interaction --no-scripts \
&& rm -rf vendor composer.*
# End warm up

COPY . .
COPY --chown=app . .

RUN rm -rf docker \
&& make install_composer \
&& make clean_assets \
&& make install_asset_dependencies \
&& make install_assets
&& make install

ADD docker/phraseanet/ /

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Expand Up @@ -5,7 +5,10 @@ install:
make install_assets

install_composer:
composer install --ignore-platform-reqs
composer install --ignore-platform-reqs --no-dev --no-suggest --classmap-authoritative --no-interaction

install_composer_dev:
composer install

install_asset_dependencies:
yarn install
Expand Down
45 changes: 23 additions & 22 deletions README.md
Expand Up @@ -32,26 +32,6 @@ You can also download a testing pre installed Virtual Machine in OVA format here

https://www.phraseanet.com/download/

# Development :

For development purpose Phraseanet is shipped with ready to use development environments using vagrant.
You can easily choose betweeen a complete build or a prebuild box, with a specific PHP version.

git clone
vagrant up --provision

then, a prompt allow you to choose PHP version, and another one to choose a complete build or an Alchemy prebuilt boxes.

Ex:
- vagrant up --provision //// 5.6 ///// 1 >> Build an ubuntu/xenial box with php5.6
- vagrant up --provision //// 7.0 ///// 1 >> Build an ubuntu/xenial with php7.0
- vagrant up --provision //// 7.2 ///// 2 >> Build the alchemy/phraseanet-php-7.2 box
- vagrant up --provision //// 5.6 ///// 1 >> Build the alchemy/phraseanet-php-5.6 box


For development with Phraseanet API see https://docs.phraseanet.com/4.0/en/Devel/index.html


# With Docker

## Prerequisites
Expand All @@ -67,7 +47,6 @@ Use `export` to override these values.
i.e:
```bash
export PHRASEANET_DOCKER_TAG=latest
export PHRASEANET_VOLUMES_DIR=/path/to/my/custom/dir
export INSTALL_ACCOUNT_EMAIL=foo@bar.com
export INSTALL_ACCOUNT_PASSWORD=$3cr3t!
export PHRASEANET_APP_PORT=8082
Expand Down Expand Up @@ -100,7 +79,7 @@ The environment is not ready yet: you have to fetch all dependencies.

This can be made easily from the builder container:

docker-compose exec -u app builder make
docker-compose run --rm -u app builder make install install_composer_dev

> Please note that the phraseanet image does not contain nor `composer` neither `node` tools. This allow the final image to be slim.
> If you need to use dev tools, ensure you are running the `builder` image!
Expand Down Expand Up @@ -131,3 +110,25 @@ Before moving all the files, or to use a different location, you have to remove
docker-compose down --volumes

Then move the files and set the `VOLUMES_DIR` to the new location.


# With Vagrant (deprecated)

## Development :

For development purpose Phraseanet is shipped with ready to use development environments using vagrant.
You can easily choose betweeen a complete build or a prebuild box, with a specific PHP version.

git clone
vagrant up --provision

then, a prompt allow you to choose PHP version, and another one to choose a complete build or an Alchemy prebuilt boxes.

Ex:
- vagrant up --provision //// 5.6 ///// 1 >> Build an ubuntu/xenial box with php5.6
- vagrant up --provision //// 7.0 ///// 1 >> Build an ubuntu/xenial with php7.0
- vagrant up --provision //// 7.2 ///// 2 >> Build the alchemy/phraseanet-php-7.2 box
- vagrant up --provision //// 5.6 ///// 1 >> Build the alchemy/phraseanet-php-5.6 box


For development with Phraseanet API see https://docs.phraseanet.com/4.0/en/Devel/index.html
53 changes: 5 additions & 48 deletions docker-compose.override.yml
Expand Up @@ -10,25 +10,27 @@ services:

gateway:
volumes:
- .:/var/alchemy
- .:/var/alchemy/Phraseanet

builder:
build:
context: .
target: builder
command: exit 0
volumes:
- .:/var/alchemy/Phraseanet

phraseanet:
environment:
- XDEBUG_ENABLED
- XDEBUG_CONFIG=remote_host=${PHRASEANET_GATEWAY_IP} idekey=${IDE_KEY} remote_enable=1 profiler_enable=${XDEBUG_PROFILER_ENABLED} profiler_output_dir=/var/alchemy/Phraseanet/cache/profiler
- PHP_IDE_CONFIG
volumes:
- .:/var/alchemy
- .:/var/alchemy/Phraseanet

worker:
volumes:
- .:/var/alchemy
- .:/var/alchemy/Phraseanet

rabbitmq:
ports:
Expand All @@ -49,48 +51,3 @@ networks:
ipam:
config:
- subnet: $PHRASEANET_SUBNET_IPS

volumes:
data_vol:
driver: local
driver_opts:
type: none
device: $PHRASEANET_VOLUMES_DIR/data
o: bind
db_vol:
driver: local
driver_opts:
type: none
device: $PHRASEANET_VOLUMES_DIR/db
o: bind
elasticsearch_vol:
driver: local
driver_opts:
type: none
device: $PHRASEANET_VOLUMES_DIR/elasticsearch
o: bind
config_vol:
driver: local
driver_opts:
type: none
device: $PHRASEANET_VOLUMES_DIR/config
o: bind
custom_vol:
driver: local
driver_opts:
type: none
device: $PHRASEANET_VOLUMES_DIR/custom
o: bind
thumbnails_vol:
driver: local
driver_opts:
type: none
device: $PHRASEANET_VOLUMES_DIR/thumbnails
o: bind
# to be replacer by stdout/stderr
logs_vol:
driver: local
driver_opts:
type: none
device: $PHRASEANET_VOLUMES_DIR/logs
o: bind
8 changes: 0 additions & 8 deletions docker-compose.yml
Expand Up @@ -9,7 +9,6 @@ services:
restart: on-failure
volumes:
- data_vol:/var/alchemy/Phraseanet/datas:rw
- custom_vol:/var/alchemy/Phraseanet/www/custom:rw
- thumbnails_vol:/var/alchemy/Phraseanet/www/thumbnails:rw
depends_on:
- phraseanet
Expand Down Expand Up @@ -50,11 +49,9 @@ services:
- INSTALL_RABBITMQ_PASSWORD=$RABBITMQ_DEFAULT_PASS
volumes:
- data_vol:/var/alchemy/Phraseanet/datas:rw
- config_vol:/var/alchemy/Phraseanet/config:rw
- tmp_vol:/var/alchemy/Phraseanet/tmp:rw
- logs_vol:/var/alchemy/Phraseanet/logs:rw
- thumbnails_vol:/var/alchemy/Phraseanet/www/thumbnails:rw
- custom_vol:/var/alchemy/Phraseanet/www/custom:rw

worker:
build:
Expand All @@ -75,7 +72,6 @@ services:
- PHP_LOG_LEVEL
volumes:
- data_vol:/var/alchemy/Phraseanet/datas:rw
- config_vol:/var/alchemy/Phraseanet/config:rw
- tmp_vol:/var/alchemy/Phraseanet/tmp:rw
- logs_vol:/var/alchemy/Phraseanet/logs:rw
- thumbnails_vol:/var/alchemy/Phraseanet/www/thumbnails:rw
Expand Down Expand Up @@ -117,10 +113,6 @@ volumes:
driver: local
elasticsearch_vol:
driver: local
config_vol:
driver: local
custom_vol:
driver: local
thumbnails_vol:
driver: local
# to be replacer by stdout/stderr
Expand Down
2 changes: 1 addition & 1 deletion docker/nginx/boot.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

set -xe

Expand Down

0 comments on commit d41268e

Please sign in to comment.