Docker

How to run Craft in Docker.

The package contains Dockerfile to quickly run application by using Docker. Below you can find commands required to run the application. You can download Docker here and install it on your operating system.

Minimal .env configuration file for Docker. For full example check the documentation

APP_ENV=dev
APP_DEBUG=1
APP_SECRET=YOUR_SECRET
DATABASE_URL=mysql://db:db@db:3306/db?charset=utf8mb4&serverVersion=mariadb-10.4.3

After configuring the .env file you can start with the Docker. Commands below must be run in the command line.

$ docker-compose build
$ docker-compose u 

# Install schema
$ docker-compose exec web php bin/console doctrine:schema:update --force

# Build CSS files
$ docker-compose exec web ./node_modules/.bin/encore production

After starting the application you can access it on the following URL http://0.0.0.0:7000 and the database (MariaDB) is running on 0.0.0.0:3306.

Last updated