Skip to content

Commit

Permalink
(maint) Use named volumes in compose where possible (#129)
Browse files Browse the repository at this point in the history
(maint) Use named volumes in compose where possible
  • Loading branch information
Iristyle authored Sep 13, 2019
2 parents ccf8999 + 2498437 commit ab5b6d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
15 changes: 11 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ services:
- PUPPERWARE_ANALYTICS_ENABLED=${PUPPERWARE_ANALYTICS_ENABLED:-true}
- PUPPETDB_SERVER_URLS=https://puppetdb.${DOMAIN:-internal}:8081
volumes:
- ${VOLUME_ROOT:-.}/volumes/code:/etc/puppetlabs/code/
- ${VOLUME_ROOT:-.}/volumes/puppet:/etc/puppetlabs/puppet/
- ${VOLUME_ROOT:-.}/volumes/serverdata:/opt/puppetlabs/server/data/puppetserver/
- puppetserver-code:/etc/puppetlabs/code/
- puppetserver-config:/etc/puppetlabs/puppet/
- puppetserver-data:/opt/puppetlabs/server/data/puppetserver/
dns_search: ${DOMAIN:-internal}
networks:
default:
Expand All @@ -43,6 +43,7 @@ services:
expose:
- 5432
volumes:
# only bind mounts currently work under LCOW for Postgres
- ${VOLUME_ROOT:-.}/volumes/puppetdb-postgres/data:/var/lib/postgresql/data
- ./postgres-custom:/docker-entrypoint-initdb.d
dns_search: ${DOMAIN:-internal}
Expand All @@ -68,9 +69,15 @@ services:
- postgres
- puppet
volumes:
- ${VOLUME_ROOT:-.}/volumes/puppetdb/ssl:/etc/puppetlabs/puppet/ssl/
- puppetdb-ssl:/etc/puppetlabs/puppet/ssl/
dns_search: ${DOMAIN:-internal}
networks:
default:
aliases:
- puppetdb.${DOMAIN:-internal}

volumes:
puppetserver-code:
puppetserver-config:
puppetserver-data:
puppetdb-ssl:
6 changes: 1 addition & 5 deletions spec/dockerfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
include Pupperware::SpecHelpers

VOLUMES = [
'volumes/code',
'volumes/puppet',
'volumes/serverdata',
'volumes/puppetdb/ssl',
'volumes/puppetdb-postgres/data'
]

Expand All @@ -23,7 +19,7 @@
fail "`docker-compose` must be installed and available in your PATH"
end
teardown_cluster()
# LCOW requires directories to exist
# LCOW requires bind mount directories to exist
create_host_volume_targets(ENV['VOLUME_ROOT'], VOLUMES)
# ensure all containers are latest versions
docker_compose('pull --quiet', stream: STDOUT)
Expand Down

0 comments on commit ab5b6d9

Please sign in to comment.