Permalink
Browse files

Improve Docker setup

  • Loading branch information...
mre authored and andygrunwald committed Jan 21, 2018
1 parent 41d32c8 commit d861b86e3af5d7bc07fedc005f4c0fb938dc93cd
Showing with 32 additions and 13 deletions.
  1. +27 −1 Dockerfile
  2. +3 −2 README.md
  3. +2 −10 docker-compose.yml
View
@@ -1,6 +1,8 @@
FROM php:7.0-fpm
# Install PHP-Extensions that are not provided by the base image
COPY . /code
# Install libraries and PHP-Extensions that are not provided by the base image
RUN apt-get update \
&& apt-get install -y \
libfreetype6-dev \
@@ -13,3 +15,27 @@ RUN apt-get update \
# Development extensions
&& pecl install xdebug-2.5.5 \
&& docker-php-ext-enable xdebug
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
RUN docker-php-ext-install zip
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp
ENV COMPOSER_VERSION 1.6.2
RUN curl -s -f -L -o /tmp/installer.php https://raw.githubusercontent.com/composer/getcomposer.org/b107d959a5924af895807021fcef4ffec5a76aa9/web/installer \
&& php -r " \
\$signature = '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061'; \
\$hash = hash('SHA384', file_get_contents('/tmp/installer.php')); \
if (!hash_equals(\$signature, \$hash)) { \
unlink('/tmp/installer.php'); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit(1); \
}" \
&& php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} \
&& composer --ansi --version --no-interaction \
&& rm -rf /tmp/* /tmp/.htaccess
WORKDIR /code
RUN composer install
View
@@ -38,12 +38,13 @@ $ # Add the content of the example configuration file below into ./inc/base/conf
$ chmod 0777 ./inc/base/config.php
$ chmod -R 0777 ./ext_inc/
$ docker-compose up
$ docker-compose run php composer install
```
This will start a [Nginx webserver](https://nginx.org/) with a [php-fpm](https://secure.php.net/manual/en/install.fpm.php) configuration and a [MySQL database](https://www.mysql.com/) for you.
After everything started you should be able to visit http://<Your-Docker-IP>:8080/ and see a running LanSuite-System.
After everything started you should be able to visit http://`<Your-Docker-IP>`:8080/ and see a running LanSuite-System.
*Attention*: This docker setup is not suggested for production.
*Attention*: This Docker setup is not suggested for production.
### Configuration file
View
@@ -8,26 +8,18 @@ services:
volumes:
- .:/code
- ./.docker/nginx-development.conf:/etc/nginx/conf.d/default.conf
networks:
- code-network
php:
image: lansuite/lansuite:latest
build:
context: .
volumes:
- .:/code
- ./.docker/nginx-php-flags.conf:/usr/local/etc/php-fpm.d/php-flags.conf
networks:
- code-network
mysql:
image: mysql:5.6
ports:
- "3306:3306"
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=lansuite
networks:
- code-network
networks:
code-network:
driver: bridge

0 comments on commit d861b86

Please sign in to comment.