Git Product home page Git Product logo

Comments (4)

petehalverson avatar petehalverson commented on August 20, 2024 4

Thank you @Harti! I really appreciate your feedback.

We've overcome the IDE hinting issue by side-loading October core code on projects ('External Libraries' in PHPStorm and 'Include Path' under NetBeans). It's a common feature for IDE's that have hinting.

Most of our projects leverage the October CMS image generated by this repo. We have a starter repo that ships with a base theme, config and plugins we use for most projects. We reference reusable and open source plugins in each project repo via Git submodules.

There's a docker-compose.yml for dev, stage and production. Here's an example:

# Reference - https://docs.docker.com/compose/compose-file/
version: '2.2'
services:
  web:
    image: aspendigital/octobercms:latest
    ports:
      - 80:80
    environment:
      - APP_DEBUG=true
      - CMS_ACTIVE_THEME=starter
      - CMS_BACKEND_SKIN=AspenDigital\Backend\Skins\Admin
      - INIT_PLUGINS=true
      - TZ=${TZ:-America/Denver}
    volumes:
      # A local `.env` is not required but expected if you wish to pass secrets to the config - see README.md
      # - ./.env:/var/www/html/.env

      - ./plugins:/var/www/html/plugins
      - ./storage/app:/var/www/html/storage/app
      - ./storage/logs:/var/www/html/storage/logs

      # Uncomment the line below for a persistent local database - see README.md
      # - ./storage/database.sqlite:/var/www/html/storage/database.sqlite

      # Mounting the entire `themes` folder can cause performance issues in Docker for Mac
      # https://docs.docker.com/compose/compose-file/#caching-options-for-volume-mounts-docker-for-mac
      - ./themes:/var/www/html/themes

We bind mount plugins and themes for persistence. That way if you hot load / update a plugin via the admin, it'll stay put.

Working on October core code / plugin is usually straight forward, just bind mount the folder/file you're working in or clone the project and bind mount everything.

Dealing with vendor folders is usually where things get tricky. Let me know if you want to take that part of the discussion further...

I started documenting some examples for a series of screencasts some time ago: https://github.com/petehalverson/docker-octobercms-examples

That stalled as I perceived a lack of interest from the community. However, recent discussions with @daftspunk have rekindled my motivation for completing that series documenting our workflow and dealing with gotchas that come with working locally with a container.

Let me know if this helps or if I haven't addressed the situations you were trying to address.

from docker-octobercms.

Harti avatar Harti commented on August 20, 2024

(Sorry for the late reply.)

Thank you so much for the detailed input! I had not known about the "external libraries" feature and knowing about it will help me for the most part, I presume.
Otherwise, docker cping the html folder onto my machine once (or whenever I require to view certain other sources) could help as far as the vendor files are concerned. While still a messy workaround, it could help in such edge cases.

Mapping the .env file is another interesting use case that might come in handy at some point. You already helped me a lot just posting this reply; of course I'd appreciate to learn more about best practices, especially when it comes to properly working with dev, staging and production environments using git. (In particular, I struggle with write permission issues once I have things set on my staging system and want to edit a page there. Not sure what's up with that - probably because the files belong to my local dev user and not the server user.)

from docker-octobercms.

pablorq avatar pablorq commented on August 20, 2024

I have had the same problem and this is the way I solve it and I'm working on developing stage, on Ubuntu.

Extract initial data

Create a docker compose file without volumes:

# docker-compose.yml
version: '2.2'
services:
  web:
    image: aspendigital/octobercms
    ports:
      - 8080:80

Start the container:

sudo docker-compose up -d

Copy files on 'html' directory inside the container to the host:

sudo docker cp [octobercms container]:/var/www/html ./html

Remove the container and volumes created

sudo docker-compose down -v

Change files owner on the host

sudo chown -R www-data:www-data ./html

At this point you have the initial data on the html directory to be used in OctoberCMS. You can copy this structure to be used for several different containers, remembering to set the correct user ownership.

Create an OctoberCMS container with persistent data

Now is time to create the working container using the extracted data, by using this docker compose file:

#docker-compose.yml
version: '2.2'
services:
  web:
    image: aspendigital/octobercms:latest
    init: true
    restart: always
    ports:
      - 8080:80
    volumes:
      - ./html:/var/www/html/

The last task is to start the container:

sudo docker-compose up -d

Great! You have an OctoberCMS container and also full access to all the data for IDEs.

from docker-octobercms.

jimcottrell avatar jimcottrell commented on August 20, 2024

You might consider checking out Visual Studio Code remote development if you like Visual Studio Code, which I do. I had to do a little tweaking to get it how I wanted, but it's pretty slick. Since you're editing inside the container, all the core files are accessible. I'd be happy to share config files if you check it out and get hung up on anything.

from docker-octobercms.

Related Issues (20)

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.