Using Docker to bring up Grav CMS

June 11, 2023 - Reading time: 2 minutes

Grav is available as a docker from Linuxserver

https://hub.docker.com/r/linuxserver/grav

The stock docker-compose.yml below

---
version: "2.1"
services:
  grav:
    image: lscr.io/linuxserver/grav:latest
    container_name: grav
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - /path/to/appdata/config:/config
    ports:
      - 80:80
    restart: unless-stopped

For use behind traefik, use the below:

---
version: "2.1"
services:
lazyblog-grav:
image: lscr.io/linuxserver/grav:latest
container_name: lazyblog_grav
environment:
- PUID=1000
- PGID=1000
- TZ=Australia/Adelaide
volumes:
- ./config:/config
restart: unless-stopped
networks:
- web
logging:
driver: journald
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
- "traefik.http.routers.lazyblog-grav.entrypoints=websecure"
- "traefik.http.routers.lazyblog-grav.rule=Host(`Your URL`)
networks:
web:
external: true

In order to get Grav to work without a IPv6 connection go to the following file:

config/nginx/site-confs/default.conf

and comment out the lines below:

listen [::]:80 default_server;


And

listen [::]:443 ssl http2 default_server;

LazyCoderOZ

I am a Linux guy, been around for 20+ years using Linux as my daily driver.
This is my blog on my discoveries and notes so I don't forget how I have done things :)