Last active
November 28, 2022 16:39
-
-
Save chriswales95/8f3536dca8e49492a75bca50bc73602d to your computer and use it in GitHub Desktop.
Mutagen compose example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
drupal: | |
depends_on: | |
- db | |
build: ./app | |
restart: unless-stopped | |
volumes: | |
- code:/app # mount the mutagen volume | |
environment: | |
COMPOSER_MEMORY_LIMIT: -1 | |
db: | |
image: mysql:8.0 | |
env_file: | |
- ./docker.env | |
restart: unless-stopped | |
stop_grace_period: 30s | |
# declare our volume | |
volumes: | |
code: | |
x-mutagen: | |
sync: | |
drupal: | |
# https://mutagen.io/documentation/synchronization | |
alpha: "./app" # local file system | |
beta: "volume://code/app" # container file system. Notice I don't mount the root of the volume itself. | |
mode: "two-way-safe" #https://mutagen.io/documentation/synchronization | |
ignore: | |
vcs: true # exclude version control | |
paths: # exclude the junk we don't need from being synced | |
- "**/node_modules/**" | |
- "**/vendor/**" | |
# permissions get kind of screwed up inside the container when mounting hence why the beta directory is 1 folder deep. This helps get around permissions issues. | |
configurationBeta: | |
permissions: | |
defaultFileMode: 0666 | |
defaultDirectoryMode: 0777 | |
# This kind of replaces the standard port forwarding. Pretty much works the same as normal forwarding and the old way still works. | |
forward: | |
drupal: | |
source: "tcp:localhost:8080" | |
destination: "network://default:tcp:drupal:80" | |
db: | |
source: "tcp:localhost:3306" | |
destination: "network://default:tcp:db:3306" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment