Giter VIP home page Giter VIP logo

craftcms3-docker's Introduction

Craft CMS 3 + Docker

Get started playing with Craft CMS 3 in a few command lines with Docker

About CraftCMS : https://github.com/craftcms
Download Docker : https://www.docker.com/community-edition#/download

๐Ÿš€ Quickstart

  • Configure env: $ cp .env.example .env
  • Start container: $ docker-compose up -d
  • Enter container: $ docker-compose exec php bash
    • $ composer install
    • $ craft install
Service Path
Website http://localhost:8080
PhpMyAdmin http://localhost:8081
Mail catcher http://localhost:8082
Logs log/

โš ๏ธ Always run commands from container (ex: docker-compose exec php craft or docker-compose exec php composer require guzzlehttp/guzzle)

๐Ÿ†™ Craft update process

  • Get the latest version number : https://github.com/craftcms/cms/releases
  • Change craftcms/cms version in composer.json
  • Start and enter container (cf: Quickstart)
  • Run $ composer update
  • Run $ craft migrate/all

โ›บ Use a virtual host

  • Run $ sudo nano /etc/hosts and add 127.0.0.1 myhost.local
  • Modify .env and set SITE_URL=myhost.local + CRAFT_PORT=80
  • Run $ docker-compose up
  • If it fails make sure no service like Apache is running on port 80

๐Ÿณ Customize PHP or Nginx image

The PHP and Nginx images are host on Docker Hub because first build takes a long time.
You can use volume in docker-compose.yml to override files in images
The docker images sources are available : https://github.com/atillay/docker-images/tree/master/craftcms3

About MySQL credentials

If you change mysql credentials in .env you have to re-create mysql container:

  • Database will be deleted, make a dump with PhpMyAdmin
  • Remove db folder : $ rm -rf docker/db
  • Run : docker-compose up
  • Re-import your database on PhpMyAdmin

Release new version on Docker Hub :
$ docker build -t atillay/craftcms3-php ./docker/php
$ docker push atillay/craftcms3-php

craftcms3-docker's People

Contributors

atillay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

craftcms3-docker's Issues

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.