GithubHelp home page GithubHelp logo

fabricemrchl / docker-grav Goto Github PK

View Code? Open in Web Editor NEW

This project forked from getgrav/docker-grav

0.0 0.0 0.0 23 KB

Official Docker Image for Grav

Home Page: https://getgrav.org

Dockerfile 100.00%

docker-grav's Introduction

Official Docker Image for Grav

This currently is pretty minimal and uses:

  • apache-2.4.38
  • GD library
  • Unzip library
  • php7.4
  • php7.4-opcache
  • php7.4-acpu
  • php7.4-yaml
  • cron
  • vim editor

Persisting data

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.

Building the image from Dockerfile

docker build -t grav:latest .

Running Grav Image with Latest Grav + Admin:

docker run -p 8000:80 grav:latest

Point browser to http://localhost:8000 and create user account...

Running Grav Image with Latest Grav + Admin with a named volume (can be used in production)

docker run -d -p 8000:80 --restart always -v grav_data:/var/www/html grav:latest

Running Grav Image with docker-compose and a volume mapped to a local directory

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

docker-grav's People

Contributors

eloquentcarbon avatar fabricemrchl avatar frunika avatar jkuester avatar johnmica avatar magikcypress avatar mathieugery avatar pgrimaud avatar pwallrich avatar rhukster avatar rotzbua avatar rouja avatar simjost avatar w00fz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.