Created
June 8, 2021 21:07
-
-
Save YuukiToriyama/5ff5a907d9e6611a8f4b89c3535e1d65 to your computer and use it in GitHub Desktop.
PostgresDB + Drupal
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' | |
services: | |
drupal: | |
image: drupal:8-apache | |
ports: | |
- 8080:80 | |
volumes: | |
- /var/www/html/modules | |
- /var/www/html/profiles | |
- /var/www/html/sites | |
- /var/www/html/themes | |
restart: always | |
postgres: | |
image: postgres | |
environment: | |
- POSTGRES_PASSWORD=mypasswd |
version: "3.7"
services:
php-apache:
image: php:8-apache
networks:
drupal_net:
volumes:
- $PWD/web:/var/www/html/web
- $PWD/vendor:/var/www/html/vendor
ports:
- 8081:80
depends_on:
- db
restart: always
db:
image: postgres:13
environment:
POSTGRES_DB: $POSTGRES_DB
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
networks:
drupal_net:
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- 5433:5432
restart: always
networks:
drupal_net:
driver: bridge
volumes:
drupal-modules:
driver_opts:
type: none
device: $PWD/web/modules
o: bind
drupal-profiles:
driver_opts:
type: none
device: $PWD/web/profiles
o: bind
drupal-themes:
driver_opts:
type: none
device: $PWD/web/themes
o: bind
drupal-sites:
driver_opts:
type: none
device: $PWD/web/sites
o: bind
postgres-data:
driver_opts:
type: none
device: $PWD/data/postgres
o: bind
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ただし、コンテナを終了する度初期化されてしまうので毎回インストールが必要。