Git Product home page Git Product logo

docker-octobercms's Introduction

Docker + October CMS

Build Status Docker Hub Pulls October CMS Build 476 Edge Build 476

The docker images defined in this repository serve as a starting point for October CMS projects.

Based on official docker PHP images, images include dependencies required by October, Composer and install the latest release.


Supported Tags

Edge Tags

Develop Tags

Legacy Tags

October CMS build 420+ requires PHP version 7.0 or higher

Quick Start

To run October CMS using Docker, start a container using the latest image, mapping your local port 80 to the container's port 80:

$ docker run -p 80:80 --name october aspendigital/octobercms:latest
# `CTRL-C` to stop
$ docker rm october  # Destroys the container

If there is a port conflict, you will receive an error message from the Docker daemon. Try mapping to an open local port (-p 8080:80) or shut down the container or server that is on the desired port.

  • Visit http://localhost using your browser.
  • Login to the backend with the username admin and password admin.
  • Hit CTRL-C to stop the container. Running a container in the foreground will send log outputs to your terminal.

Run the container in the background by passing the -d option:

$ docker run -p 80:80 --name october -d aspendigital/octobercms:latest
$ docker stop october  # Stops the container. To restart `docker start october`
$ docker rm october  # Destroys the container

Working with Local Files

Using Docker volumes, you can mount local files inside a container.

The container uses the working directory /var/www/html for the web server document root. This is where the October CMS codebase resides in the container. You can replace files and folders, or introduce new ones with bind-mounted volumes:

# Developing a plugin
$ git clone [email protected]:aspendigital/oc-resizer-plugin.git
$ cd oc-resizer-plugin
$ docker run -p 80:80 --rm \
  -v $(pwd):/var/www/html/plugins/aspendigital/resizer \
  aspendigital/octobercms:latest

Save yourself some keyboards strokes, utilize docker-compose by introducing a docker-compose.yml file to your project folder:

# docker-compose.yml
version: '2.2'
services:
  web:
    image: aspendigital/octobercms
    ports:
      - 80:80
    volumes:
      - $PWD:/var/www/html/plugins/aspendigital/resizer

With the above example saved in working directory, run:

$ docker-compose up -d # start services defined in `docker-compose.yml` in the background
$ docker-compose down # stop and destroy

Database Support

SQLite

On build, an SQLite database is created and initialized for the Docker image. With that database, users have immediate access to the backend for testing and developing themes and plugins. However, changes made to the built-in database will be lost once the container is stopped and removed.

When projects require a persistent SQLite database, copy or create a new database to the host which can be used as a bind mount:

# Create and provision a new SQLite database:
$ touch storage/database.sqlite
$ docker run --rm \
  -v $(pwd)/storage/database.sqlite:/var/www/html/storage/database.sqlite \
  aspendigital/octobercms php artisan october:up

# Now run with the volume mounted to your host
$ docker run -p 80:80 --name october \
 -v $(pwd)/storage/database.sqlite:/var/www/html/storage/database.sqlite \
 aspendigital/octobercms

MySQL / Postgres

Alternatively, you can host the database using another container:

#docker-compose.yml
version: '2.2'
services:
  web:
    image: aspendigital/octobercms:latest
    ports:
      - 80:80
    environment:
      - DB_TYPE=mysql
      - DB_HOST=mysql #DB_HOST should match the service name of the database container
      - DB_DATABASE=octobercms
      - DB_USERNAME=root
      - DB_PASSWORD=root

  mysql:
    image: mysql:5.7
    ports:
      - 3306:3306
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=octobercms

Provision a new database with october:up:

$ docker-compose up -d
$ docker-compose exec web php artisan october:up

Cron

You can start a cron process by setting the environment variable ENABLE_CRON to true:

$ docker run -p 80:80 -e ENABLE_CRON=true aspendigital/octobercms:latest

Separate the cron process into it's own container:

#docker-compose.yml
version: '2.2'
services:
  web:
    image: aspendigital/octobercms:latest
    init: true
    restart: always
    ports:
      - 80:80
    environment:
      - TZ=America/Denver
    volumes:
      - ./.env:/var/www/html/.env
      - ./plugins:/var/www/html/plugins
      - ./storage/app:/var/www/html/storage/app
      - ./storage/logs:/var/www/html/storage/logs
      - ./storage/database.sqlite:/var/www/html/storage/database.sqlite
      - ./themes:/var/www/html/themes

  cron:
    image: aspendigital/octobercms:latest
    init: true
    restart: always
    command: [cron, -f]
    environment:
      - TZ=America/Denver
    volumes_from:
      - web

Command Line Tasks

Run the container in the background and launch an interactive shell (bash) for the container:

$ docker run -p 80:80 --name containername -d aspendigital/octobercms:latest
$ docker exec -it containername bash

Commands can also be run directly, without opening a shell:

# artisan
$ docker exec containername php artisan env

# composer
$ docker exec containername composer info

A few helper scripts have been added to the image:

# `october` invokes `php artisan october:"$@"`
$ docker exec containername october up

# `artisan` invokes `php artisan "$@"`
$ docker exec containername artisan plugin:install aspendigital.resizer

# `tinker` invokes `php artisan tinker`. Requires `-it` for an interactive shell
$ docker exec -it containername tinker

App Environment

By default, APP_ENV is set to docker.

On image build, a default .env is created and config files for the docker app environment are copied to /var/www/html/config/docker. Environment variables can be used to override the included default settings via docker run or docker-compose.

Note: October CMS settings stored in a site's database override the config. Active theme, mail configuration, and other settings which are saved in the database will ultimately override configuration values.

PHP configuration

Recommended settings for opcache and PHP are applied on image build.

Values set in docker-oc-php.ini can be overridden by passing one of the supported PHP environment variables defined below.

To customize the PHP configuration further, add or replace .ini files found in /usr/local/etc/php/conf.d/.

Environment Variables

Environment variables can be passed to both docker-compose and October CMS.

Database credentials and other sensitive information should not be committed to the repository. Those required settings should be outlined in .env.example

Passing environment variables via Docker can be problematic in production. A phpinfo() call may leak secrets by outputting environment variables. Consider mounting a .env volume or copying it to the container directly.

Docker Entrypoint

The following variables trigger actions run by the entrypoint script at runtime.

Variable Default Action
ENABLE_CRON false true starts a cron process within the container
FWD_REMOTE_IP false true enables remote IP forwarding from proxy (Apache)
GIT_CHECKOUT Checkout branch, tag, commit within the container. Runs git checkout $GIT_CHECKOUT
GIT_MERGE_PR Pass GitHub pull request number to merge PR within the container for testing
INIT_OCTOBER false true runs october up on container start
INIT_PLUGINS false true runs composer install in plugins folders where no 'vendor' folder exists. force runs composer install regardless. Helpful when using git submodules for plugins.
PHP_DISPLAY_ERRORS off Override value for display_errors in docker-oc-php.ini
PHP_MEMORY_LIMIT 128M Override value for memory_limit in docker-oc-php.ini
PHP_POST_MAX_SIZE 32M Override value for post_max_size in docker-oc-php.ini
PHP_UPLOAD_MAX_FILESIZE 32M Override value for upload_max_filesize in docker-oc-php.ini
UNIT_TEST true runs all October CMS unit tests. Pass test filename to run a specific test.
VERSION_INFO false true outputs container current commit, php version, and dependency info on start
XDEBUG_ENABLE false true enables the Xdebug PHP extension
XDEBUG_REMOTE_HOST host.docker.internal Override value for xdebug.remote_host in docker-xdebug-php.ini

October CMS app environment config

List of variables used in config/docker

Variable Default
APP_DEBUG false
APP_KEY 0123456789ABCDEFGHIJKLMNOPQRSTUV
APP_URL http://localhost
APP_LOCALE en
CACHE_STORE file
CMS_ACTIVE_THEME demo
CMS_BACKEND_FORCE_SECURE false
CMS_BACKEND_SKIN Backend\Skins\Standard
CMS_BACKEND_URI backend
CMS_DATABASE_TEMPLATES false
CMS_DISABLE_CORE_UPDATES true
CMS_EDGE_UPDATES false (true in edge images)
CMS_LINK_POLICY detect
DB_DATABASE -
DB_HOST mysql*
DB_PASSWORD -
DB_PORT -
DB_REDIS_HOST redis*
DB_REDIS_PASSWORD null
DB_REDIS_PORT 6379
DB_SQLITE_PATH storage/database.sqlite
DB_TYPE sqlite
DB_USERNAME -
MAIL_DRIVER log
MAIL_FROM_ADDRESS [email protected]
MAIL_FROM_NAME October CMS
MAIL_SMTP_ENCRYPTION tls
MAIL_SMTP_HOST -
MAIL_SMTP_PASSWORD -
MAIL_SMTP_PORT 587
MAIL_SMTP_USERNAME -
QUEUE_DRIVER sync
SESSION_DRIVER file
TZ** UTC

* When using a container to serve a database, set the host value to the service name defined in your docker-compose.yml

** Timezone applies to both container and October CMS config


October

docker-octobercms's People

Contributors

aspendigital-bot avatar harti avatar nearlyflightless avatar petehalverson avatar tobias-kuendig 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  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  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  avatar  avatar  avatar  avatar

docker-octobercms's Issues

cron runs with different env variables

By default, cron does not care about the environment variables that are set in the Dockerfile. This means that all scheduled cronjobs will run with a completely different configuration ‒ in my case they run against the wrong database.

A workaround for this is to print all env variables to /etc/environment where crontab will pick them up.

Adding this line to the entrypoint script will fix this problem:

printenv  >> /etc/environment

Dependency build tags not always current

Forcing dependencies to use the same build 4a5e203 has proven to cause issues:

  • Dependency tags aren't always bumped at the same time as the October core
  • Packagist sometimes takes a while to update

Instead of strictly adhering to the current October core build, should to something like '<=CURRENT_BUILD'.

This wouldn't resolve the issue encountered when a dependency version is bumped and Packagist isn't current at build time. However, that corner case seems to be mitigated by Automat's build interval.

can I have https at local port

when I was developing at local site. sometimes I need using ngrok to reflect the local environment to the outside world. but it seems it doesn't have some config that can let me to do this.
so How can I have 127.0.0.1:443 open?
ideally, if I can set ports at docker-compose file just like this:

    ports:
      - 80:80
      - 443:443

it will be great.

I tried:

ports:
      - 80:80
      - 443:80

but the template still using http:// not https for the source files

Build 465 images are not accessible

According to the README build 465 images are available. However, a docker pull for them fails:

$ docker pull aspendigital/octobercms:build.465-php7.4-apache                                               
Error response from daemon: manifest for aspendigital/octobercms:build.465-php7.4-apache not found

Bad protocol version. Please update to a newer version of October CMS (Build >472 or >v1.1.5) and try again.

It seems like newest version of this container hase some issues with installing plugins from web. Using Backend and Console also will give

Bad protocol version. Please update to a newer version of October CMS (Build >472 or >v1.1.5) and try again.

for installing RainLab.User Plugin. Since this is currently only reproducable for Docker Images it may be related with this image and not with October CMS itself (did not discover that on any production system, also that error message is not even existing in whole source code). Fun fact: there is no October CMS Version > 472 or >v1.1.5 ;-)

Workaround is to just git clone the Plugin directly into plugins directory inside the container and do a php artisan plugin:refresh RainLab.User

Any help appreciated - BR, Gladder

Installing Plugin Dependencies on `docker-compose up`

I have used this docker package on a project with a custom plugin mapped as a volume. This plugin has a bunch of free marketplace plugins listed as dependencies in Plugin::$require .

I was hoping octoberCMS would catch this on install, and add all the dependencies for my Plugin - but it's not that slick.

What is the recommended way to install a list of octoberCMS plugins on docker-compose up?

Best practices for "deep" development?

Thanks for making this Dockerfile/repo; it's saved me a lot of time so far!

I love how cleanly you can develop with pushing/pulling only a handful of folders, and keeping it separate from the core OctoberCMS business logic.
At the same time, it (or rather, development with Docker in general) gives me major headaches once I go beyond editing layout files.

Especially for OctoberCMS plugin development, but also in some other edge cases (such as overriding component templates), I need to see the whole sources, as my IDE will then be able to auto-import required classes and auto-complete methods, give me type hints and such. It also helps to quickly dig into the framework code to see how other plugin developers have dealt with what I am trying to achieve.

Sometimes, I also find myself wanting to install another plugin - and it wouldn't persist unless I also added it to my Dockerfile. Its settings will be gone as well unless I somehow get the database to sync over (which works mapping the SQLite database, but I'd rather like to switch to an external database such as MySQL at some point).

How do you handle/manage such situations?

Invalid security token

Hello!
I am using traefik as my reverse-proxy and set its config as traefik.frontend.passHostHeader=true. Although, I am always getting Invalid security token error while logging into the backend.
Any suggestion to fix this?

Actualize tags of images in Docker Hub

Hello!

I see the difference in tags list in README and actual tags in Docker Hub. For example, https://registry.hub.docker.com/r/aspendigital/octobercms says build.473-php7.3-apache tag exists, but it isn't. The last OctoberCMS version for the php7.3-apache tag is 471: https://registry.hub.docker.com/r/aspendigital/octobercms/tags?page=1&ordering=last_updated&name=-php7.3-apache

Could you fix your image build scripts and publish tags with the 473 version of OctoberCMS?

Wrong url / missing port in storage/app urls

OC runs on Port 80 behind a reverse proxy (nginx container) with ssl termination which runs on port 8443.
I can get all content with https://:8443 but not the images stored in /var/www/html/storage/app/...

In all URLs, except for the storage urls, the port 8443 is present. See attached screenshot from the chrome web developer tools showing the urls.

125451981-4b8dacc8-524b-40ca-859e-5d3c64898d64

my oc docker-compose.yml:

version: "3.8"
services:
	web:
		image: "aspendigital/octobercms:php7.4-apache"
		container_name: "octobercms"
		environment:
			  - DB_TYPE=mysql
			  - DB_HOST=mariadb
			  - DB_DATABASE=octobercms
			  - DB_USERNAME=octobercms
			  - DB_PASSWORD=octobercms
			  - CMS_LINK_POLICY=secure
			  - VIRTUAL_HOST=<external ip nginx proxy>
			  - VIRTUAL_PROTO=http
			  - VIRTUAL_PORT=8443                        
		networks:
			  - "dmz"
		volumes:
			  - /srv/octobercms/plugins:/var/www/html/plugins
			  - /srv/octobercms/storage/app:/var/www/html/storage/app
			  - /srv/octobercms/storage/logs:/var/www/html/storage/logs
			  - /srv/octobercms/themes:/var/www/html/themes


	mariadb:
		image: "mariadb:10.6.2"
		container_name: "database"
		restart: always
		environment:
			  MYSQL_RANDOM_ROOT_PASSWORD: 1
			  MYSQL_DATABASE: octobercms
			  MYSQL_USER: octobercms
			  MYSQL_PASSWORD: octobercms
		volumes:
			  - /srv/octobercms/mysql/data:/var/lib/mysql
		networks:
			  - "dmz"

networks:
		  dmz:
			  external: true

my nginx docker-compose.yml:

version: "3.8"
  
services:
    reverse-proxy:
		  build: .
		  container_name: "reverse-proxy"
		  restart: "always"
		  networks:
			  - "dmz"
		  ports:
			  - "8443:8443"
  
networks:
	dmz:
		  external: true

nginx.conf server block:

server {
	listen 			8443 ssl;
	server_name 	<external ip>;

	ssl_certificate 		/etc/ssl/certificate.pem;
	ssl_certificate_key 	/etc/ssl/certificate.key;

	location / {
		proxy_pass 				"http://octobercms:80";
		proxy_set_header Host 	$host;
		proxy_cache 			off;
	}
}

Enable Supervisor?

Can we have an additional variable like ENABLE_SUPERVISOR? And this is going to install the supervisor, config file and run. For the sake of database queues. For example, it might look like this.

  • Dockerfile
    RUN apt-get update && apt-get install -y supervisor
    COPY october-worker.conf /etc/supervisor/conf.d/october-worker.conf
    ADD ./run.sh /run.sh
    RUN chmod a+x /run.sh

  • run.sh
    #!/bin/sh
    set -e
    php artisan october:up
    exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf

  • october-worker.conf
    [program:october-worker]
    process_name=%(program_name)s_%(process_num)02d
    command=/usr/local/bin/php /var/www/html/artisan queue:work --sleep=3 --tries=3
    autostart=true
    autorestart=true
    user=root
    numprocs=4
    redirect_stderr=true
    stdout_logfile=/var/www/html/worker.log

Making sense?

Getting "Page not found" when trying to run a php script

Getting the following when trying to run a simple php script that sends a mail - even just a php script that echo's "hello" does not seem to work:

image

But if I place say a text file in that exact same directory you see in the URL and try and access it via the web browser I am able to download/view the file.

What could be wrong here?

Error with php7.2-apache image in composer autoloading

Right now when I start the image it cannot load certain files.

PHP Fatal error: Class Illuminate\\Database\\Eloquent\\Collection contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Illuminate\\Contracts\\Queue\\QueueableCollection::getQueueableRelations) in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Collection.php on line 11

this error is caused by the following read error:

PHP Fatal error: Uncaught Error: Class 'October\\Rain\\Database\\Collection' not found in /var/www/html/vendor/october/rain/src/Database/Model.php:608
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(261): October\\Rain\\Database\\Model->newCollection(Array)
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1477): Illuminate\\Database\\Eloquent\\Builder->hydrate(Array)
#2 /var/www/html/vendor/october/rain/src/Extension/ExtendableTrait.php(411): Illuminate\\Database\\Eloquent\\Model->__call('hydrate', Array)
#3 /var/www/html/vendor/october/rain/src/Database/Model.php(635): October\\Rain\\Database\\Model->extendableCall('hydrate', Array)
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(481): October\\Rain\\Database\\Model->__call('hydrate', Array)
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(465): Illuminate\\Database\\Eloquent\\Builder->getModels(Array)
#6 /var/www/html/vendor/laravel in /var/www/html/vendor/october/rain/src/Database/Model.php on line 608

I can get it to work if I simply run composer install -o once inside the container - which indicates to me that the composer autoloading seems to be broken in some way

Tinker issue on php7.1 image

Trips after trying to run php artisan tinker after closing a previous tinker session:

[ErrorException] rmdir(/tmp/php-xdg-runtime-dir-fallback-): Directory not empty

It looks like the issue is limited to php7.1 and should be addressed with the next update from the psysh maintainer: bobthecow/psysh#430 (comment)

Problem writing to the storage directory

I'm attempting to get a fresh copy working but I'm getting this error:

Cannot create directory: /var/www/html/storage/cms/cache/91/8c

My docker-compose.yml file looks like this:

version: '2.2'

services:
  composer:
    image: composer:latest
    volumes:
      - ./:/app
    working_dir: /app

  october:
    image: aspendigital/octobercms:latest
    volumes:
      - ./db/database.sqlite:/var/www/html/storage/database.sqlite
      - ./plugins/rainlab/user:/var/www/html/plugins/rainlab/user
      - ./:/var/www/html/plugins/jd/dingoapi
    ports:
      - 9090:80
    environment:
      - APACHE_RUN_USER=www-data
      - CACHE_STORE=database
      - APP_DEBUG=true
      - API_PREFIX=api
      - API_DEBUG=true
      - JWT_TTL=31622400
      - JWT_BLACKLIST_ENABLED=false
      - API_DEFAULT_FORMAT=json

If I remove the CACHE_STORE env variable I get this error:

file_put_contents(/var/www/html/storage/framework/cache/11/de/11de31e1eabb2682cf62ee9c9ccb0630f1019006): failed to open stream: No such file or directory

I have tried with and without mounted volumes. My last resort was to add the APACHE_RUN_USER env variable, but again I get the same issue with or without it.

I'm running Docker for Mac and my version of Docker is 19.03.8, build afacb8b.

These are the permissions of the storage directories:

drwxrwsr-x 1 www-data www-data   4096 May  3 12:51 .
drwxrwxrwx 1 www-data www-data   4096 Feb 20 07:02 ..
-rw-r--r-- 1 www-data www-data      9 Feb 20 07:02 .gitignore
drwxrwsr-x 4 www-data www-data   4096 Feb 20 07:02 app
drwxrwsr-x 5 www-data www-data   4096 Feb 20 07:02 cms
-rwxrwxr-x 1 www-data www-data 806912 May  3 12:51 database.sqlite
drwxrwsr-x 1 www-data www-data   4096 Feb 20 07:02 framework
drwxrwsr-x 1 www-data www-data   4096 May  3 12:51 logs
drwxrwsr-x 3 www-data www-data   4096 Feb 20 07:02 temp

Any help would be much appreciated, thanks!

Add kubernetes charts

I'm proposing that this repo adds kubernetes charts for deploying october cms on kubernetes.

I'm happy to share my solution but i'm quite new to october cms and don't know all relevant files and configuration.

PHP 7.4 support

Hi Aspendigital,

I like this docker image :)
Can we have a PHP 7.4 image?

Xdebug error

When enabling xdebug, it's looking for a file called "docker-xdebug-php.ini", and when it's not found, an error message called "Xdebug config not found. Try the develop image" appears. This file is not generated during setup and there are no instructions on how to create it.

how can i change the default APP_KEY

can i can the default APP_KEY?
Am I need put APP_KEY in .env file?
if everybody using the default APP_KEY, is that will be a problem for security? Thanks

nginx and mariadb version ?

Hi,
I'm looking for docker image working on Ubuntu last version (18.04) with :

Nginx
PHP last version (7.1 / 7.2) PHP-FPM
Mariadb
Octobercms (last release)

Thx

Help add ssl

Please give any example to add ssl for domains

Enabling cron can block startup process

When cron is enabled and scheduler is used in ocms, then the startup process blocks.

instead of

  php artisan schedule:run # required to prime db connection
  cron
  echo 'Cron enabled.'

should be

        echo 'Adding crontab job'
        echo "* * * * * /usr/local/bin/php /var/www/html/artisan schedule:run > /proc/1/fd/1 2>/proc/1/fd/2" | tee -a /var/spool/cron/root
        echo 'Starting cron service'
        service cron start
        echo 'Cron enabled.'

Move October Drivers to the image

When testing queues, the October Drivers plugin is required. I addressed this by introducing a check to the entrypoint (3054d70), but still run into race conditions when multiple containers are used.

Instead of complicating the entrypoint further, I think I'll just take the hit on the image size required to bundle them in on build

Update README with ssl notes

Please update the README file and add a section where ssl is documented:

I've had a problem that my configuration in config/cms.php was overwritten by CMS_LINK_POLICY env of the docker image. Same goes for APP_URL etc.

Theme volume assets not found in browser

I am having an issue with a volume I created for a theme I am loading on the host machine. I.e

volumes:
    - src/exampletheme:/var/www/html/themes/exampletheme

and this works by showing the theme in the backend but my stylesheets, scripts are not found.

I initially thought this was an issue with permissions but its not as I set the permissions to that exampletheme and subsequent folders as such:

chmod -R 2755 exampletheme

This changed permissions but still couldn't see the files in the browser.

Themes downloaded and installed from the admin work however.

Any thoughts?

Mounting new .env caused created the file on host by root instead of www-data

I have a problem that I wanted to mounted new file called .env, but in the host it created by root instead of www-data

Step to reproduce

  1. existing docker images run by docker-compose up -d before
  2. Add new file in the local called .env
  3. update docker-compose.yml to mount new file
    - ./.env:/var/www/html.env
  4. The new .env shows created and owned by root instead of ww-data

It's caused the application error.

How I can solved it ?

Page empty

Here is my docker-compose.yml:

version: '3.3'
services:
  web:
    image: aspendigital/octobercms
    restart: always
    container_name: octobermovies
    ports:
      - 8800:80
    volumes:
      - ./storage:/var/www/html/storage
      - ./plugins:/var/www/html/plugins
      - ./themes:/var/www/html/themes

The page will be blank.

Then I change my docker-compose.yml to this:

version: '3.3'
services:
  web:
    image: aspendigital/octobercms
    restart: always
    container_name: octobermovies
    ports:
      - 8800:80
    volumes:
      - ./storage/app:/var/www/html/storage/app
      - ./storage/logs:/var/www/html/storage/logs
      - ./storage/database.sqlite:/var/www/html/storage/database.sqlite
      - ./plugins/myplugin:/var/www/html/plugins/myplugin
      - ./themes/newtheme:/var/www/html/themes/newtheme

It works then.

I noticed it's because the folder will be removed when the folder in host is mapped to a folder in container. Is there a way to keep the data in container? Thanks.

403 Forbidden

Try use you docker image for start working with octobercms.
Use docker-compose.yml from readme.md.

#docker-compose.yml
version: '3'
services:
  web:
    image: aspendigital/octobercms:build.431-php7.0-apache
    ports:
      - 127.0.0.1:4000:80
    environment:
      DB_TYPE: mysql
      DB_HOST: mysql #DB_HOST should match the service name of the database container
      DB_DATABASE: october
      DB_USERNAME: october
      DB_PASSWORD: Y5gExv_p
    volumes:
      - $PWD/october:/var/www/html/
  mysql:
    image: mysql:5.7
    ports:
      - 3306:3306
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: october
      MYSQL_USER: october
      MYSQL_PASSWORD: Y5gExv_p

I got success install containers and october not installed.

-rw-r--r--  1 dimensi dimensi  631 feb  8 03:02 docker-compose.yml
drwxrwxrwx  2 dimensi dimensi 4096 feb  8 02:55 october

October dir is empty. What i do wrong?
I connect to container and cd to /var/www/html and this dir is empty too.

Trying to user PHP 7.4-apache Dockerfile : Composer Error

Hi,
I'm trying to use the PHP 7.4-apache Dockerfile and I'm getting the following errors :

[RuntimeException] No composer.json present in the current directory, this may be the cause of the following exception.

[InvalidArgumentException]
Package hirak/prestissimo has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version

Basically it fails at this command :

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
/usr/local/bin/composer global require hirak/prestissimo

I'm trying to build this with the whole PHP 7.4-apache folder.

Any ideas ?

How to enable more PHP Extensions?

I currently have a project with the Offline Mall plugin for OctoberCMS. When I try to access the checkout page I get an error. When I check the logs I the following error:

RuntimeException: Missing BC Math or GMP extension. in /var/www/html/plugins/offline/mall/vendor/hashids/hashids/src/Math.php:113

After some research it seems as the BC Math or GMP extension is not enabled. How can I go about enable these extensions in my docker image?

Container slow to start

Suggest we move the permissions rewrite to the image build instead of doing it via the entrypoint

Always the edge core version gets installed

No matter which tag I choose, this always installs the latest edge version of october.

For example, when running aspendigital/octobercms:build.455-php7.1-apache, the composer.json will contain the following dependencies:
"october/system": "~1.0"

This will result in the following resolved dependencies (composer.lock):
`

           "name": "october/system",
           "version": "v1.0.457",
            "source": {
                "type": "git",
                "url": "https://github.com/octoberrain/system.git",
                "reference": "55239f2d0113b5dac77fd9ff4d3f1a61525f348d"
            }`

safe_mode is currently enabled

Can't add any PHP code into a static page. It shows an error "safe_mode is currently enabled". How to disable or fix this problem?

MySQL install results in unknown athentication method?

docker-compose exec web php artisan october:up

[Illuminate\Database\QueryException]
  SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema =
  octobercms and table_name = migrations)

Am I doing something wrong?

error when : artisan october:up

when i try to : docker-compose exec web php artisan october:up

i got this message : Could not open input file: artisan

inside container var/www/html/ there is 3 folder only nothing else. no composer and artisan file

Support for OctoberCMS V2.0

Hi Team,

Great work on the docker-octobercms I have 2 questions

  1. Do you have a suggested CI/CD workflow for dockerized octobercms?
  2. Are you guys working on Octobercms v2.0?

how to set PHP max_execution_time ?

how can I increase this php params ?
because I want upload some big file on backend.
is there any elegant way like just set:
"PHP_POST_MAX_SIZE","PHP_MEMORY_LIMIT","PHP_UPLOAD_MAX_FILESIZE" ?

thanks
截屏2020-03-23下午7 48 27

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.