Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active September 24, 2023 17:24
Show Gist options
  • Save stevewithington/7cd6aa41f2a873a9c362223d55cc9e27 to your computer and use it in GitHub Desktop.
Save stevewithington/7cd6aa41f2a873a9c362223d55cc9e27 to your computer and use it in GitHub Desktop.
Drupal with Postgres Docker Compose File
version: '2'
# Note: use the database service name `db` in the Host IP Address field ...
# Or, `docker container inspect {postgrescontainerid}` to obtain the IP Address needed for completing the Drupal setup screen.
services:
# Postgres
db:
image: postgres:9.6.5-alpine
restart: always
environment:
POSTGRES_DB: drupaldb
POSTGRES_USER: drupaluser
POSTGRES_PASSWORD: drupalpassword
volumes:
- db_data:/var/lib/postgresql/data
ports:
- 5432:5432
# Drupal
cms:
image: drupal:8.3.7-apache
restart: always
ports:
- 8080:80
volumes:
- cms_modules:/var/www/html/modules
- cms_profiles:/var/www/html/profiles
- cms_themes:/var/www/html/themes
- cms_sites:/var/www/html/sites
depends_on:
- db
# Volumes
volumes:
db_data:
cms_modules:
cms_profiles:
cms_themes:
cms_sites:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment