Skip to content

Instantly share code, notes, and snippets.

@mulderu
Created January 12, 2018 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mulderu/5de4b914060ad8208db9efcafde02bc4 to your computer and use it in GitHub Desktop.
Save mulderu/5de4b914060ad8208db9efcafde02bc4 to your computer and use it in GitHub Desktop.
concrete5, cms, docker

concrete5 setup by docker

reference : https://hub.docker.com/r/chriswayg/concrete5.7/

Docker-Compose

Alternatively to the above, using docker-compose create the data-volume, database and Concrete5.7 containers all in one step, as can be seen in docker-compose-datavol.yml. Or if you prefer, use host volumes as shown below:

$ cd c5
$ cat docker-compose.yml

db:
  image: mariadb
  restart: always
  environment:
  - MYSQL_ROOT_PASSWORD=the_db_root_password
  - MYSQL_USER=c5dbadmin
  - MYSQL_PASSWORD=the_db_user_password
  - MYSQL_DATABASE=c5db
  # host volume
  volumes:
    - ./data/var/lib/mysql:/var/lib/mysql

web:
  image: chriswayg/concrete5.7
  restart: always
  ports:
  - "80:80"
  - "443:443"
  links:
  - db
  # host volumes 
  volumes:
    - ./data/etc/apache2:/etc/apache2
    - ./data/var/www/html:/var/www/html

$ docker-compose up -d

Concrete5 Setup

Visit your Concrete5 site at https://example.org for initial setup.

On the setup page, set your site-name and admin user password and enter the following

    Database Information:
    Server:          db
    MySQL Username:  c5dbadmin
    MySQL Password:  the_db_user_password
    Database Name:   c5db

Data will persist

The Concrete5 and MariaDB application containers can be removed (even with docker rm -f -v), upgraded and reinitialized without loosing website or database data, as all website data is stored in the DATA container. (Just do not delete the DATA container;)

To find out where the data is stored on disk, check with docker inspect c5_DATA_1 | grep -A1 Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment