Merge pull request #7102 from tuxgasy/develop_docker

Add docker-compose.yml file to build development environment based on Docker
This commit is contained in:
Laurent Destailleur
2017-08-17 22:36:58 +02:00
committed by GitHub
6 changed files with 76 additions and 23 deletions

View File

@@ -1,16 +0,0 @@
build
build.xml
ChangeLog
composer.json
CONTRIBUTING.md
COPYING
COPYRIGHT
dev
doc
Dockerfile
INSTALL
README-FR.md
README.md
robots.txt
scripts
test

View File

@@ -0,0 +1,3 @@
Dockerfile
README.md
docker-compose.yml

View File

@@ -1,4 +1,7 @@
FROM php:5.6-apache
FROM php:7.0-apache
ENV HOST_USER_ID 33
ENV PHP_INI_DATE_TIMEZONE 'UTC'
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
&& rm -rf /var/lib/apt/lists/* \
@@ -9,11 +12,9 @@ RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
&& docker-php-ext-install mysqli \
&& apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev
COPY htdocs/ /var/www/html/
RUN chown -hR www-data:www-data /var/www/html
VOLUME /var/www/html/conf
VOLUME /var/www/html/documents
COPY docker-run.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-run.sh
EXPOSE 80
ENTRYPOINT ["docker-run.sh"]

25
build/docker/README.md Normal file
View File

@@ -0,0 +1,25 @@
# How to use it ?
The docker-compose.yml file is used to build and run Dolibarr in the current workspace.
Before build/run, define the variable HOST_USER_ID as following:
export HOST_USER_ID=$(id -u)
Go in repository build/docker :
cd build/docker
And then, you can run :
docker-compose up
This will run 3 container Docker : Dolibarr, MariaDB and PhpMyAdmin.
The URL to go to the Dolibarr is :
http://0.0.0.0
The URL to go to PhpMyAdmin is (login/password is root/root) :
http://0.0.0.0:8080

View File

@@ -0,0 +1,25 @@
mariadb:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dolibarr
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
PMA_HOST: mariadb
links:
- mariadb
ports:
- "8080:80"
web:
build: .
environment:
HOST_USER_ID: $HOST_USER_ID
volumes:
- ../../htdocs:/var/www/html
links:
- mariadb
ports:
- "80:80"

View File

@@ -0,0 +1,15 @@
#!/bin/bash
usermod -u $HOST_USER_ID www-data
groupmod -g $HOST_USER_ID www-data
chown -hR www-data:www-data /var/www
if [ ! -f /usr/local/etc/php/php.ini ]; then
cat <<EOF > /usr/local/etc/php/php.ini
date.timezone = $PHP_INI_DATE_TIMEZONE
display_errors = On
EOF
fi
exec apache2-foreground