aspendigital / docker-octobercms

Dockerized October CMS: PHP, Composer, October core and dependencies
MIT License
150 stars 54 forks source link

403 Forbidden #8

Closed dimensi closed 6 years ago

dimensi commented 6 years ago

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.

albrechtsimon commented 6 years ago

The OctoberCMS files get added to the image during build. See the Dockerfile. Volume mounts are created when launching a container. As far as I know, mounts are directed from host system towards container system, which in turn means that if your directory on the host system is empty when it gets mounted, it will be empty within your container as well.

petehalverson commented 6 years ago

@albrechtsimon, that's correct. The October CMS files exist in the image. I typically create volume bind mounts for those folders I'm working on. Here's an example from a typical project:

#docker-compose.yml
version: '2.3'
services:
  web:
    image: aspendigital/octobercms:latest
    init: true
    ports:
      - 80:80
    environment:
      - TZ=${TZ:-America/Denver}
    volumes:
      # A local `.env` is not required but expected if you wish to override config values
      # - ./.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
      # - ./storage/database.sqlite:/var/www/html/storage/database.sqlite

      - ./themes:/var/www/html/themes

@edDimensi, I noticed your example uses docker-compose version 3 which handles volumes differently. I have stuck with version 2.x as it matches my workflow. See more about the difference: https://github.com/docker/compose/issues/4675

petehalverson commented 6 years ago

@edDimensi, apologies for not seeing this issue sooner. Closing now...please let me know if you have any more trouble or if you'd like to offer some additional feedback.

Thanks!

dimensi commented 6 years ago

@petehalverson i anyway can't understand how copy files from container to host for development?

dimensi commented 6 years ago

@petehalverson i can't understand how fix permissions issue. If i try copy you config and open localhost, i got error about "not exists system.log file", if i create systel.log file i got permission denied

petehalverson commented 6 years ago

The October CMS Slack #docker channel would be a better forum to discuss.

@dimensi, it's not clear to me what you're trying to do.

You can mount a local volume as described above, log in to the container, and copy them via command line.