Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP:MacOS shared folder config + cached option #38

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ SITE_NAME=Site name
COMPOSER_REQUIRE=solarium/solarium:3.6.*
PROJECT_INSTALL=
PHP_VERSION=7.1
SHARED_FOLDER=/dev/shm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please give it better name a-la MYSQL_DATA_DIR

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif

build: clean
mkdir -p build
mkdir -p /dev/shm/${COMPOSE_PROJECT_NAME}_mysql
mkdir -p ${SHARED_FOLDER}/${COMPOSE_PROJECT_NAME}_mysql

install:
@echo "Updating containers..."
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ For Linux install <a href="https://docs.docker.com/compose/install/" target="_bl

5\. Run `make`

Additional steps for MacOS install: (https://docs.docker.com/docker-for-mac/osxfs-caching/)

2\.4\. Set SHARED_FOLDER variable to any writable absolute path instead of /dev/shm (PROJECT_PATH/sql for example)

3\. Copy __docker-compose\.override\.yml\.default_mac__ to __docker-compose\.override\.yml__

## Usage

* `make` - Install project.
Expand Down
44 changes: 44 additions & 0 deletions src/docker/docker-compose.override.yml.default_mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: "2"

services:

# Override base service.
php:
volumes:
- ../../build:/var/www/html:cached
- ../${PROFILE_NAME}:/var/www/html/profiles/${PROFILE_NAME}:cached
- ../modules:/var/www/html/modules/custom:cached
- ../themes:/var/www/html/themes/custom:cached
- "./90-mail.ini:/etc/php${PHP_VERSION}/conf.d/90-mail.ini:cached"
- ../../config/sync:/var/www/html/sync:cached
# Uncomment next line if you need PHP XDebug.
# command: php-fpm7 -F -d zend_extension=xdebug.so

# adminer:
# image: dockette/adminer:mysql-php7
# container_name: "${COMPOSE_PROJECT_NAME}_adminer"
# links:
# - mysql:mysql
# depends_on:
# - mysql
# networks:
# - front

mailhog:
image: skilldlabs/mailhog
container_name: "${COMPOSE_PROJECT_NAME}_mail"
restart: always
networks:
- front

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here better to add then override for ports of mailhog too.
ports: - "8025:8025"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep Macos needs portmapping, better to add it here

mysql:
volumes:
- ${SHARED_FOLDER}/${COMPOSE_PROJECT_NAME}_mysql:/var/lib/mysql:cached


nginx:
ports:
- "8086:80"
# Mount local folder with ssl keys.
# volumes:
# - ./nginx/ssl:/etc/nginx/ssl:Z
2 changes: 1 addition & 1 deletion src/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
image: percona:5.7
container_name: "${COMPOSE_PROJECT_NAME}_mysql"
volumes:
- /dev/shm/${COMPOSE_PROJECT_NAME}_mysql:/var/lib/mysql:Z
- ${SHARED_FOLDER}/${COMPOSE_PROJECT_NAME}_mysql:/var/lib/mysql:Z
environment:
MYSQL_DATABASE: d8
MYSQL_USER: d8
Expand Down