No description
Find a file
2021-01-22 12:36:54 +00:00
.vscode Have pecl extensions managed by renovate () 2021-01-22 12:30:57 +00:00
1.6 Update dependency php/pecl-file_formats-yaml to v2.2.1 2021-01-22 12:36:54 +00:00
1.7 Update dependency php/pecl-file_formats-yaml to v2.2.1 2021-01-22 12:36:54 +00:00
.drone.yml Fix indentation 2020-07-11 17:48:19 +02:00
entrypoint.sh Usermod the correct user 2020-06-30 12:20:47 +02:00
grav.ini Move entrypoint and grav.ini back to root 2020-04-07 10:28:30 +02:00
README.md Update README 2020-07-24 22:04:17 +02:00
renovate.json Configure Renovate () 2020-06-12 12:49:03 +00:00

Grav - docker

Docker container for GRAV CMS.

This image is based on the PHP:7.3.*-fpm-buster image.

You can find the source here

Tags

  • latest
  • 1.6
  • 1.6.*
  • 1.7-rc.*
  • 1.7.*-rc.*

Usage

This is purely php-fpm bash image, which means you need another container to act as the webserver, I recommend nginx. For a nginx config to use with GRAV, you can have a look at the GRAV documentation

GRAV is by default installed into /var/www/html where you will find all the folders from a normal GRAV install. A user has been created in container with a default id of 33 (same as www-data).

To provide your site data to the container simply do use a volume mount to the desired folder. You can see the docker-compose example at the bottom for an example with volume mount and nginx webserver.

When you deploy or update the docker container it will replace all the neccessary files and leave all folders with potential user generated content. The following folders are ignored

backup/
logs/
tmp/
vendor/
user/

All other folders will be overwritten, which also means that it's very easy to up and down grade your version of GRAV.

After the GRAV files have been installed a bin/grav install will be run to install the correct composer dependencies into vendor and all plugins specified in your dependencies file, if you have one. Lastly the cache will be cleared.

You can customise the user id and group id the container user runs as, and the folder name under /var/www, that GRAV will be installed into, with environment variables:

UID=1000
GID=1000
GRAV_FOLDER=awesome-site

With the above options the container user will run with a user id and group id of 1000. Grav will be installed into /var/www/awesome-site.

Commandline

You can easily use GRAV's commandline interface using docker exec

docker exec -u www-data CONTAINER bin/(gpm|grav|plugin)

Updating

To update the container you simple download the new container and replace it with the old one. For docker-compose that would be

docker-compose pull
docker-compose up -d

Example docker-compose

This is a sample docker-compose file using this image along with the official nginx container.

version: '2'

volumes:
  grav:

networks:
  frontend:

services:
  app:
    image: mwalbeck/getgrav:latest
    restart: on-failure:5
    networks:
      - frontend
    volumes:
      - grav:/var/www/html
      - /path/to/user:/var/www/html/user
    environment:
      - UID=1000
      - GID=1000
      - GRAV_FOLDER=awesome-grav-site

  web:
    image: nginx:latest
    restart: on-failure:5
    networks:
      - frontend
    volumes:
      - /path/to/nginx:/etc/nginx:ro
    volumes_from:
      - app:ro
    ports:
      - 80:80
      - 443:443