Last active
June 14, 2022 14:43
-
-
Save rotated8/00c808a71ccf7326442245a03308d4b6 to your computer and use it in GitHub Desktop.
Docker Compose for Drupal
This file contains 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
# Drupal with PostgreSQL | |
# Adapted from https://hub.docker.com/_/drupal/ | |
# | |
# Access via "http://localhost:8080" | |
# (or "http://$(docker-machine ip):8080" if using docker-machine) | |
# | |
# Database type: PostgreSQL | |
# Database name: postgres | |
# Database username: postgres | |
# Database password: example | |
# ADVANCED OPTIONS; Database host: postgres | |
version: '3.1' | |
services: | |
drupal: | |
image: drupal:9-apache | |
ports: | |
- 8080:80 | |
volumes: | |
- ./modules:/var/www/html/modules | |
- ./profiles:/var/www/html/profiles | |
- ./themes:/var/www/html/themes | |
- ./sites:/var/www/html/sites | |
restart: always | |
postgres: | |
image: postgres:10 | |
environment: | |
POSTGRES_PASSWORD: example | |
restart: always |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This assumes your
modules
,profiles
,themes
, andsites
folders are in the current directory.Run
docker stack deploy -c stack.yml drupal
ordocker-compose -f stack.yml up
, wait for initialization, then visit http://localhost:8080