Container to deploy bozzochet/grav website
1.2K
I just took the official one and I substituted the curl command downloading Grav with a git clone (from https://github.com/bozzochet/grav) that download my entire website.
Then a simple call to a bash script (install.sh) deploy it completely.
I also added two crontab entries
install_plugins.sh) every night to add new plugins added to the script (and updated by the pull from github half an hours earlier or in any previous hourly update)The website is not planned to have 'persistency' so the comments below are not relevant (I kept just for inventory benefit). Once built (as described below or by simply downloading the image from DockerHub, https://hub.docker.com/r/bozzochet/docker-grav) I simply run with
docker run -d -p 8000:80 grav:latest
or
docker run -d -p 8000:80 bozzochet/docker-grav:latest
(after pulling from DockerHub with docker pull bozzochet/docker-grav) and the process runs in background.
I can connect to it by:
docker exec -it --user root <contained ID> /bin/bash
or
docker exec -it --user www-data <contained ID> /bin/bash
This currently is pretty minimal and uses:
To save the Grav site data to the host file system (so that it persists even after the container has been removed), simply map the container's /var/www/html directory to a named Docker volume or to a directory on the host.
If the mapped directory or named volume is empty, it will be automatically populated with a fresh install of Grav the first time that the container starts. However, once the directory/volume has been populated, the data will persist and will not be overwritten the next time the container starts.
docker build -t grav:latest .
docker run -p 8000:80 grav:latest
Point browser to http://localhost:8000 and create user account...
docker run -d -p 8000:80 --restart always -v grav_data:/var/www/html grav:latest
Running docker-compose up -d with the following docker-compose configuration will automatically build the Grav image (if the Dockerfile is in the same directory as the docker-compose.yml file). Then the Grav container will be started with all of the site data persisted to a named volume (stored in the ./grav directory.
volumes:
grav-data:
driver: local
driver_opts:
type: none
device: $PWD/grav
o: bind
services:
grav:
build: ./
ports:
- 8080:80
volumes:
- grav-data:/var/www/html
Content type
Image
Digest
Size
993.5 MB
Last updated
over 5 years ago
docker pull bozzochet/docker-grav