Git Product home page Git Product logo

docker-contao's Introduction

Contao Docker Container

Image Size Docker Stars Docker Pulls Docker Automated buil

  • Based on CentOS 7
  • Apache 2.4 (event)
  • PHP 7.3
  • Preinstalled composer
  • Auto-adjust DocumentRoot for Contao 4
  • Configured for Contao CMS
  • Ability to change UID of Apache to circumvent permission problems
  • Includes some useful tools and presets like git, curl, bashrc and vimrc
  • Xdebug (disabled by default), Imagemagick, php-(bcmath,intl,json,mbstring,mcrypt,mysql,snmp,soap,xml)

Usage

// Start MySQL/MariaDB first
sudo docker run --rm --name mysql \
  -e MYSQL_ROOT_PASSWORD=root \
  -v $HOME/contao/_db:/var/lib/mysql \
  mariadb

// take contao installation from $HOME/contao/contao
sudo docker run --rm --name contao \
  -v $HOME/contao/contao:/var/www \
  --link mysql:mysql \
  -p 80:80 \
  -e RUN_UID=$UID \
  -e XDEBUG=true \
  -e PHP_VALUE=max_execution_time=90,memory_limit=512M \
  psitrax/contao

// enter the Container
sudo docker exec -ti contao bash
root at 53e71dbf4adc in ~ su apache
apache at 53e71dbf4adc in /var/www ~ composer create-project contao/standard-edition website

// if permission problems occour change owner
root at 53e71dbf4adc in ~ chown -R apache /var/www

// or managed edition
apache at 53e71dbf4adc in /var/www ~ composer create-project contao/managed-edition website

apache at 53e71dbf4adc in /var/www ~ mv website/* website/.gitignore .
// Restart Container to detect Contao 4

Configuration

Use Environment Variables for Configuration

  • TIMEZONE=America/New_York Adjust the timezone (Default: Europe/Berlin)
  • RUN_UID The UID of internal apache User. Set it to your local UID to prevent file access problmes while developing.
  • XDEBUG=true Enable xdebug (disabled by default)
  • PHP_VALUE / PHP_ADMIN_VALUE / PHP_FLAG Overwrite arbitrary PHP settings: eg max_execution_time=90,memory_limit=512M

Maintainer

docker-contao's People

Contributors

psi-4ward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-contao's Issues

Insecure document root

Due to the change in Contao 4 I cannot run the install tool because web is not the document root.

The apache servers /var/www, but contao will not be happy unless only web/ is seen from outside.

# ll /var/www/
total 260K
drwxr-xr-x  3 apache apache 4.0K Jul  3 14:49 app
drwxr-xr-x 25 apache apache 4.0K Jul  3 15:04 assets
drwxr-xr-x  2 apache apache 4.0K Jul  3 14:49 bin
-rw-r--r--  1 apache apache   37 Jul  3 14:49 CHANGELOG.md
-rw-r--r--  1 apache apache 2.4K Jul  3 14:49 composer.json
-rw-r--r--  1 apache apache 201K Jul  3 14:49 composer.lock
drwxr-xr-x  2 apache apache 4.0K Jul  3 14:53 files
-rw-r--r--  1 apache apache   17 Dec 11  2016 index.php
-rw-r--r--  1 apache apache 2.3K Jul  3 14:49 README.md
drwxr-xr-x  7 apache apache 4.0K Jul  3 14:53 system
drwxr-xr-x  2 apache apache 4.0K Jul  3 14:53 templates
drwxr-xr-x  4 apache apache 4.0K Jul  3 14:21 var
drwxr-xr-x 41 apache apache 4.0K Jul  3 15:04 vendor
drwxr-xr-x  7 apache apache 4.0K Jul  3 15:05 web
drwxr-xr-x  6 apache apache 4.0K Jul  3 15:02 website

I tried creating a virtual host but neither a2ensite or a2enmod are available in your container.
How did you manage to run it?

Also there are no sites files. The apache2 folder is named httpd. However, all tutorials use:
cp /etc/apache2/sites-available/default /etc/apache2/sites-available/example.com

Contao Error message:

What's the matter?

Your installation is not secure, because non-public resources are publicy available via HTTP.

How can I fix the issue?

Please set the document root to the web/ subfolder. This is usually done in the domain routing section of your server administration panel or in the vhosts file of your web server.

Tell me more, please

Contao 4 no longer relies on .htaccess files to protect folders and instead uses a public subfolder as document root. Anything above the document root must not be accessible via HTTP, otherwise anyone could download non-public resources including sensitive data such as configuration files.

contao managed edition

Can this docker container work also for contao managed edition in similar way?
thanks

Autodetect Contao4

Hi,

kann es sein, dass der Autodetect mit der aktuellen composer.json nicht funktioniert. wir haben jetzt als Workaround ein Comment gesetzt, damit er das detected. Ist das so gedacht?

install.php gets downloaded instead of executed

Hello,

after running your image and downloading contao LTS curl -L http://download.contao.org/lts | tar -xzp I'm getting to the "incomplete installation" page which is fine so far.
Now I'm trying to open up the /contao/install.php to finish the installation, the file just gets downloaded, instead of executed.

Any help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.