Comments (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.
(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 cp
ing 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.
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.
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)
- PHP 7.4 support HOT 1
- how to set PHP max_execution_time ? HOT 2
- Add kubernetes charts
- Update README with ssl notes HOT 2
- Problem writing to the storage directory HOT 4
- Build 465 images are not accessible HOT 1
- cron runs with different env variables HOT 4
- Theme volume assets not found in browser
- Xdebug error HOT 1
- Installing Plugin Dependencies on `docker-compose up` HOT 1
- Trying to user PHP 7.4-apache Dockerfile : Composer Error HOT 4
- [Feature Request] Upgrade to Octobercms v1.1 HOT 2
- Enable Supervisor? HOT 1
- Bad protocol version. Please update to a newer version of October CMS (Build >472 or >v1.1.5) and try again. HOT 2
- How to enable more PHP Extensions? HOT 1
- Support for OctoberCMS V2.0 HOT 1
- Actualize tags of images in Docker Hub HOT 1
- Wrong url / missing port in storage/app urls
- Google Cloud Run Dockerfile version? HOT 1
- How to use Dockerfile for actual new version of October CMS?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-octobercms.