Skip to content

Instantly share code, notes, and snippets.

@MurzNN
Created April 28, 2022 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MurzNN/b2b4b01e1a8abd43e2403794f686569e to your computer and use it in GitHub Desktop.
Save MurzNN/b2b4b01e1a8abd43e2403794f686569e to your computer and use it in GitHub Desktop.
$ cat .ddev/.ddev-docker-compose-base.yaml
version: '3.6'
#ddev-generated
services:
db:
container_name: ddev-${DDEV_SITENAME}-db
build:
context: './.dbimageBuild'
args:
BASE_IMAGE: $DDEV_DBIMAGE
username: 'alexey_korepov'
uid: '1000'
gid: 1000
image: ${DDEV_DBIMAGE}-${DDEV_SITENAME}-built
stop_grace_period: 60s
working_dir: "/home/alexey_korepov"
volumes:
- type: "volume"
source: "database"
target: "/var/lib/mysql"
volume:
nocopy: true
- .:/mnt/ddev_config
- ./db_snapshots:/mnt/snapshots
- ddev-global-cache:/mnt/ddev-global-cache
restart: "no"
# The postgres image is set up for user 999, we won't try to change that.
user: '$DDEV_UID:$DDEV_GID'
hostname: test1-db
ports:
- "127.0.0.1:$DDEV_HOST_DB_PORT:3306"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.platform: ddev
com.ddev.app-type: drupal9
com.ddev.approot: $DDEV_APPROOT
environment:
- COLUMNS
- DDEV_HOSTNAME
- DDEV_PHP_VERSION
- DDEV_PRIMARY_URL
- DDEV_PROJECT
- DDEV_PROJECT_TYPE
- DDEV_ROUTER_HTTP_PORT
- DDEV_ROUTER_HTTPS_PORT
- DDEV_SITENAME
- DDEV_TLD
- DOCKER_IP=127.0.0.1
- HOST_DOCKER_INTERNAL_IP=172.17.0.1
- IS_DDEV_PROJECT=true
- LINES
- MYSQL_HISTFILE=/mnt/ddev-global-cache/mysqlhistory/${DDEV_SITENAME}-db/mysql_history
- MYSQL_PWD=db
- PGDATABASE=db
- PGHOST=localhost
- PGPASSWORD=db
- PGUSER=db
- POSTGRES_PASSWORD=db
- POSTGRES_USER=db
- POSTGRES_DB=db
- TZ=
command: ${DDEV_DB_CONTAINER_COMMAND}
healthcheck:
interval: 1s
retries: 120
start_period: 120s
timeout: 120s
web:
container_name: ddev-${DDEV_SITENAME}-web
build:
context: './.webimageBuild'
args:
BASE_IMAGE: $DDEV_WEBIMAGE
username: 'alexey_korepov'
uid: '1000'
gid: '1000'
image: ${DDEV_WEBIMAGE}-${DDEV_SITENAME}-built
networks: ["default", "ddev_default"]
cap_add:
- SYS_PTRACE
working_dir: "/var/www/html/"
volumes:
- type: bind
source: ../
target: /var/www/html
consistency: cached
- ".:/mnt/ddev_config:ro"
- "./xhprof:/usr/local/bin/xhprof:ro"
- "ddev-global-cache:/mnt/ddev-global-cache"
- "ddev-ssh-agent_socket_dir:/home/.ssh-agent"
restart: "no"
user: '$DDEV_UID:$DDEV_GID'
hostname: test1-web
ports:
- "127.0.0.1:$DDEV_HOST_WEBSERVER_PORT:80"
- "127.0.0.1:$DDEV_HOST_HTTPS_PORT:443"
environment:
- COLUMNS
- DOCROOT=${DDEV_DOCROOT}
- DDEV_DOCROOT
- DDEV_HOSTNAME
- DDEV_PHP_VERSION
- DDEV_PRIMARY_URL
- DDEV_PROJECT
- DDEV_PROJECT_TYPE
- DDEV_ROUTER_HTTP_PORT
- DDEV_ROUTER_HTTPS_PORT
- DDEV_SITENAME
- DDEV_TLD
- DDEV_FILES_DIR
- DDEV_WEBSERVER_TYPE
- DDEV_XDEBUG_ENABLED
- DEPLOY_NAME=local
- DRUSH_OPTIONS_URI=$DDEV_PRIMARY_URL
- DRUSH_ALLOW_XDEBUG=1
- DOCKER_IP=127.0.0.1
- HOST_DOCKER_INTERNAL_IP=172.17.0.1
# HTTP_EXPOSE allows for ports accepting HTTP traffic to be accessible from <site>.ddev.site:<port>
# To expose a container port to a different host port, define the port as hostPort:containerPort
- HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILHOG_PORT}:8025
# You can optionally expose an HTTPS port option for any ports defined in HTTP_EXPOSE.
# To expose an HTTPS port, define the port as securePort:containerPort.
- HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80,${DDEV_MAILHOG_HTTPS_PORT}:8025
- IS_DDEV_PROJECT=true
- LINES
- MYSQL_HISTFILE=/mnt/ddev-global-cache/mysqlhistory/${DDEV_SITENAME}-web/mysql_history
- MYSQL_PWD=db
- PGDATABASE=db
- PGHOST=db
- PGPASSWORD=db
- PGUSER=db
- PHP_IDE_CONFIG=serverName=${DDEV_SITENAME}.${DDEV_TLD}
- SSH_AUTH_SOCK=/home/.ssh-agent/socket
- TZ=
- VIRTUAL_HOST=${DDEV_HOSTNAME}
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.platform: ddev
com.ddev.app-type: drupal9
com.ddev.approot: $DDEV_APPROOT
extra_hosts: [ "host.docker.internal:172.17.0.1" ]
external_links:
- "ddev-router:test1.ddev.site"
healthcheck:
interval: 1s
retries: 120
start_period: 120s
timeout: 120s
dba:
container_name: ddev-${DDEV_SITENAME}-dba
image: $DDEV_DBAIMAGE
working_dir: "/root"
restart: "no"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.platform: ddev
com.ddev.app-type: drupal9
com.ddev.approot: $DDEV_APPROOT
expose:
- "80"
hostname: test1-dba
environment:
- PMA_USER=root
- PMA_PASSWORD=root
- VIRTUAL_HOST=$DDEV_HOSTNAME
- UPLOAD_LIMIT=1024M
- TZ=
# HTTP_EXPOSE allows for ports accepting HTTP traffic to be accessible from <site>.ddev.site:<port>
- HTTP_EXPOSE=${DDEV_PHPMYADMIN_PORT}:8036
- HTTPS_EXPOSE=${DDEV_PHPMYADMIN_HTTPS_PORT}:8036
healthcheck:
interval: 120s
timeout: 2s
retries: 1
networks:
ddev_default:
name: ddev_default
external: true
volumes:
database:
name: "test1-mariadb"
external: true
ddev-ssh-agent_socket_dir:
external: true
ddev-global-cache:
name: ddev-global-cache
external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment