forked from Wavyzz/dolibarr
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:
3
build/docker/.dockerignore
Normal file
3
build/docker/.dockerignore
Normal file
@@ -0,0 +1,3 @@
|
||||
Dockerfile
|
||||
README.md
|
||||
docker-compose.yml
|
||||
20
build/docker/Dockerfile
Normal file
20
build/docker/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
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/* \
|
||||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
||||
&& docker-php-ext-install gd \
|
||||
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
|
||||
&& docker-php-ext-install ldap \
|
||||
&& docker-php-ext-install mysqli \
|
||||
&& apt-get purge -y libpng12-dev libjpeg-dev libldap2-dev
|
||||
|
||||
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
25
build/docker/README.md
Normal 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
|
||||
25
build/docker/docker-compose.yml
Normal file
25
build/docker/docker-compose.yml
Normal 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"
|
||||
15
build/docker/docker-run.sh
Normal file
15
build/docker/docker-run.sh
Normal 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
|
||||
Reference in New Issue
Block a user