Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

docker-sync #10

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
!dev-ops/docker/_volumes/.gitkeep
/plugins/
!/plugins/.gitkeep
/.docker-sync/
/plugins_old/
!/plugins_old/.gitkeep
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ You can then access your storefront at:

- Front-end: [http://10.100.111.46/](http://10.100.111.46/)

#### docker-sync

Install [docker-sync](http://docker-sync.io/) on your macOS host machine: `gem install docker-sync`.

Copy (replace) `docker-compose.docker-sync.yml` to `docker-compose.yml`.

Run `docker-sync start` before `./psh.phar docker:start`.

You might be asked to install some unison tools.

Enjoy faster development :-)

## Troubleshooting

If the elasticsearch or redis container didn't start make sure that the directory dev-ops/docker/_volumes/app-esdata|app-redisdata has chmod 777.
67 changes: 67 additions & 0 deletions docker-compose.docker-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: '2'

services:
app_server:
build: dev-ops/docker/containers/php7
volumes:
- ~/.composer/cache:/var/www/composer-cache-dir
- app_server-sync:/project:nocopy
- app_server-sync:/var/www/shopware:nocopy
links:
- app_mysql:mysql
environment:
TERM: xterm
COMPOSER_CACHE_DIR: /var/www/composer-cache-dir
ports:
- "80:80"
networks:
sw_docker:
ipv4_address: 10.100.111.46

app_mysql:
build: dev-ops/docker/containers/mysql
volumes:
- ./dev-ops/docker/_volumes/app-mysql-data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: app
MYSQL_PASSWORD: app
networks:
sw_docker:
ipv4_address: 10.100.111.47

app_es:
build: dev-ops/docker/containers/elastic-search
volumes:
- ./dev-ops/docker/containers/elastic-search/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- ./dev-ops/docker/_volumes/app-es-data:/usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"
environment:
TERM: xterm
ES_JAVA_OPTS: "-Xmx256m -Xms256m"
networks:
sw_docker:
ipv4_address: 10.100.111.48

app_redis:
build: dev-ops/docker/containers/redis
volumes:
- ./dev-ops/docker/_volumes/app-redisdata:/data
networks:
sw_docker:
ipv4_address: 10.100.111.49

networks:
sw_docker:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.100.111.0/24
gateway: 10.100.111.1

volumes:
app_server-sync:
external: true
7 changes: 7 additions & 0 deletions docker-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "2"

syncs:
#IMPORTANT: ensure this name is unique and does not match your other application container name
app_server-sync: #tip: add -sync and you keep consistent names as a convention
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey, please add the right sync_userid and sync_groupid. Also, exclude the unnecessary files e.g.
sync_excludes: ['.git', '.idea', 'dev-ops/docker/_volumes', 'var', '.docker-sync'].

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can see an example here: shopware/development@d161be8

sync_strategy: 'unison'
src: './'