Codebase
Mounted codebase
Describe the bug
Using POSTGRES 9.6-1.6.1 image I noticed that the .sql files in postgres-init folder was not being loaded and causing the container to exit. I created the container without the data and noticed that the postgres user was missing. I was under the impression that the postgres user got created by default regardless... However this does not seem to be the case.
On previous versions of docker4drupal this was working but seems to be related to the postgres image - seems to be related to this issue:
https://github.com/docker-library/postgres/issues/41
Output of docker info
Containers: 7
Running: 7
Paused: 0
Stopped: 0
Images: 11
Server Version: 18.09.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 2.933GiB
Name: linuxkit-025000000001
ID: 27AG:CKMR:ELRP:45H4:COV2:YTAR:CHZY:EA5R:UNQI:JBJJ:JFE2:FNMR
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Contents of your docker-compose.yml
version: "3"
services:
# mariadb:
# image: wodby/mariadb:$MARIADB_TAG
# container_name: "${PROJECT_NAME}_mariadb"
# stop_grace_period: 30s
# environment:
# MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
# MYSQL_DATABASE: $DB_NAME
# MYSQL_USER: $DB_USER
# MYSQL_PASSWORD: $DB_PASSWORD
# volumes:
# - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
# - /path/to/mariadb/data/on/host:/var/lib/mysql # Use bind mount
php:
image: wodby/drupal-php:$PHP_TAG
container_name: "${PROJECT_NAME}_php"
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
# PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S opensmtpd:25
DB_HOST: $DB_HOST
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
DB_DRIVER: $DB_DRIVER
PHP_FPM_USER: wodby
PHP_FPM_GROUP: wodby
COLUMNS: 80 # Set 80 columns for docker exec -it.
## Read instructions at https://wodby.com/stacks/drupal/docs/local/xdebug/
PHP_XDEBUG: 1
PHP_XDEBUG_DEFAULT_ENABLE: 1
PHP_XDEBUG_REMOTE_CONNECT_BACK: 0
PHP_IDE_CONFIG: serverName=amg_php
PHP_XDEBUG_REMOTE_HOST: host.docker.internal # Docker 18.03+ Mac/Win
# PHP_XDEBUG_REMOTE_HOST: 172.17.0.1 # Linux
# PHP_XDEBUG_REMOTE_HOST: 10.254.254.254 # macOS, Docker < 18.03
# PHP_XDEBUG_REMOTE_HOST: 10.0.75.1 # Windows, Docker < 18.03
# PHP_XDEBUG_REMOTE_LOG: /tmp/php-xdebug.log
volumes:
# - ./:/var/www/html
## For macOS users (https://wodby.com/stacks/drupal/docs/local/docker-for-mac/)
- ./app:/var/www/html:cached # User-guided caching
# - docker-sync:/var/www/html # Docker-sync
## For XHProf and Xdebug profiler traces
# - files:/mnt/files
nginx:
image: wodby/nginx:$NGINX_TAG
container_name: "${PROJECT_NAME}_nginx"
depends_on:
- php
environment:
NGINX_STATIC_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html
NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET
# NGINX_DRUPAL_FILE_PROXY_URL: http://example.com
volumes:
# - ./:/var/www/html
# For macOS users (https://wodby.com/stacks/drupal/docs/local/docker-for-mac/)
- ./app:/var/www/html:cached # User-guided caching
# - docker-sync:/var/www/html # Docker-sync
labels:
- 'traefik.backend=${PROJECT_NAME}_nginx'
- 'traefik.port=80'
- 'traefik.frontend.rule=Host:${PROJECT_BASE_URL}'
mailhog:
image: mailhog/mailhog
container_name: "${PROJECT_NAME}_mailhog"
labels:
- 'traefik.backend=${PROJECT_NAME}_mailhog'
- 'traefik.port=8025'
- 'traefik.frontend.rule=Host:mailhog.${PROJECT_BASE_URL}'
postgres:
image: wodby/postgres:$POSTGRES_TAG
container_name: "${PROJECT_NAME}_postgres"
ports:
- "6432:5432"
stop_grace_period: 30s
environment:
POSTGRES_PASSWORD: $DB_PASSWORD
POSTGRES_DB: $DB_NAME
POSTGRES_USER: $DB_USER
volumes:
- ./postgres-init:/docker-entrypoint-initdb.d # Place init file(s) here.
# - /path/to/postgres/data/on/host:/var/lib/postgresql/data # Use bind mount
# apache:
# image: wodby/apache:$APACHE_TAG
# container_name: "${PROJECT_NAME}_apache"
# depends_on:
# - php
# environment:
# APACHE_LOG_LEVEL: debug
# APACHE_BACKEND_HOST: php
# APACHE_VHOST_PRESET: php
# APACHE_DOCUMENT_ROOT: /var/www/html/web
# volumes:
# - ./:/var/www/html
## For macOS users (https://wodby.com/stacks/drupal/docs/local/docker-for-mac/)
## - ./:/var/www/html:cached # User-guided caching
## - docker-sync:/var/www/html # Docker-sync
# labels:
# - 'traefik.backend=${PROJECT_NAME}_apache'
# - 'traefik.port=80'
# - 'traefik.frontend.rule=Host:${PROJECT_BASE_URL}'
# varnish:
# image: wodby/varnish:$VARNISH_TAG
# container_name: "${PROJECT_NAME}_varnish"
# depends_on:
# - nginx
# environment:
# VARNISH_SECRET: secret
# VARNISH_BACKEND_HOST: nginx
# VARNISH_BACKEND_PORT: 80
# VARNISH_CONFIG_PRESET: drupal
# VARNISH_ALLOW_UNRESTRICTED_PURGE: 1
# labels:
# - 'traefik.backend=${PROJECT_NAME}_varnish'
# - 'traefik.port=6081'
# - 'traefik.frontend.rule=Host:varnish.${PROJECT_BASE_URL}'
# redis:
# container_name: "${PROJECT_NAME}_redis"
# image: wodby/redis:$REDIS_TAG
# adminer:
# container_name: "${PROJECT_NAME}_adminer"
# image: wodby/adminer:$ADMINER_TAG
# environment:
## For PostgreSQL:
## ADMINER_DEFAULT_DB_DRIVER: pgsql
# ADMINER_DEFAULT_DB_HOST: $DB_HOST
# ADMINER_DEFAULT_DB_NAME: $DB_NAME
# labels:
# - 'traefik.backend=${PROJECT_NAME}_adminer'
# - 'traefik.port=9000'
# - 'traefik.frontend.rule=Host:adminer.${PROJECT_BASE_URL}'
# pma:
# image: phpmyadmin/phpmyadmin
# container_name: "${PROJECT_NAME}_pma"
# environment:
# PMA_HOST: $DB_HOST
# PMA_USER: $DB_USER
# PMA_PASSWORD: $DB_PASSWORD
# PHP_UPLOAD_MAX_FILESIZE: 1G
# PHP_MAX_INPUT_VARS: 1G
# labels:
# - 'traefik.backend=${PROJECT_NAME}_pma'
# - 'traefik.port=80'
# - 'traefik.frontend.rule=Host:pma.${PROJECT_BASE_URL}'
# solr:
# image: wodby/solr:$SOLR_TAG
# container_name: "${PROJECT_NAME}_solr"
# environment:
# SOLR_DEFAULT_CONFIG_SET: $SOLR_CONFIG_SET
# SOLR_HEAP: 1024m
# labels:
# - 'traefik.backend=${PROJECT_NAME}_solr'
# - 'traefik.port=8983'
# - 'traefik.frontend.rule=Host:solr.${PROJECT_BASE_URL}'
# drupal-node:
# image: wodby/drupal-node:$DRUPAL_NODE_TAG
# container_name: "${PROJECT_NAME}_drupal_nodejs"
# environment:
# NODE_SERVICE_KEY: node-service-key
# labels:
# - 'traefik.backend=${PROJECT_NAME}_nodejs'
# - 'traefik.port=8080'
# - 'traefik.frontend.rule=Host:nodejs.${PROJECT_BASE_URL}'
# volumes:
# - ./path/to/your/single-page-app:/app
# command: sh -c 'npm install && npm run start'
# memcached:
# container_name: "${PROJECT_NAME}_memcached"
# image: wodby/memcached:$MEMCACHED_TAG
# rsyslog:
# container_name: "${PROJECT_NAME}_rsyslog"
# image: wodby/rsyslog:$RSYSLOG_TAG
# athenapdf:
# image: arachnysdocker/athenapdf-service:$ATHENAPDF_TAG
# container_name: "${PROJECT_NAME}_athenapdf"
# environment:
# WEAVER_AUTH_KEY: weaver-auth-key
# WEAVER_ATHENA_CMD: "athenapdf -S"
# WEAVER_MAX_WORKERS: 10
# WEAVER_MAX_CONVERSION_QUEUE: 50
# WEAVER_WORKER_TIMEOUT: 90
# WEAVER_CONVERSION_FALLBACK: "false"
node:
image: wodby/node:$NODE_TAG
container_name: "${PROJECT_NAME}_node"
working_dir: /usr/src/app/sites/all/themes/AMG
labels:
- 'traefik.backend=${PROJECT_NAME}_node'
- 'traefik.port=3000'
- 'traefik.frontend.rule=Host:front.${PROJECT_BASE_URL}'
expose:
- "3000"
volumes:
- ./app/sites/all/themes/AMG:/usr/src/app/sites/all/themes/AMG
command: sh -c 'yarn install && yarn run start'
# blackfire:
# image: blackfire/blackfire
# container_name: "${PROJECT_NAME}_blackfire"
# environment:
# BLACKFIRE_SERVER_ID: XXXXX
# BLACKFIRE_SERVER_TOKEN: YYYYY
# webgrind:
# image: wodby/webgrind:$WEBGRIND_TAG
# container_name: "${PROJECT_NAME}_webgrind"
# environment:
# WEBGRIND_PROFILER_DIR: /mnt/files/xdebug/profiler
# labels:
# - 'traefik.backend=webgrind'
# - 'traefik.port=8080'
# - 'traefik.frontend.rule=Host:webgrind.${PROJECT_BASE_URL}'
# volumes:
# - files:/mnt/files
# elasticsearch:
# image: wodby/elasticsearch:$ELASTICSEARCH_TAG
# environment:
# ES_JAVA_OPTS: "-Xms500m -Xmx500m"
# ulimits:
# memlock:
# soft: -1
# hard: -1
# kibana:
# image: wodby/kibana:$KIBANA_TAG
# depends_on:
# - elasticsearch
# labels:
# - 'traefik.backend=${PROJECT_NAME}_kibana'
# - 'traefik.port=5601'
# - 'traefik.frontend.rule=Host:kibana.php.docker.localhost'
# opensmtpd:
# container_name: "${PROJECT_NAME}_opensmtpd"
# image: wodby/opensmtpd:$OPENSMTPD_TAG
# xhprof:
# image: wodby/xhprof:$XHPROF_TAG
# restart: always
# volumes:
# - files:/mnt/files
# labels:
# - 'traefik.backend=${PROJECT_NAME}_xhprof'
# - 'traefik.port=8080'
# - 'traefik.frontend.rule=Host:xhprof.${PROJECT_BASE_URL}'
portainer:
image: portainer/portainer
container_name: "${PROJECT_NAME}_portainer"
command: --no-auth -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- 'traefik.backend=${PROJECT_NAME}_portainer'
- 'traefik.port=9000'
- 'traefik.frontend.rule=Host:portainer.${PROJECT_BASE_URL}'
traefik:
image: traefik
container_name: "${PROJECT_NAME}_traefik"
command: -c /dev/null --web --docker --logLevel=INFO
ports:
- '8000:80'
# - '8080:8080' # Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
#volumes:
## Docker-sync for macOS users
# docker-sync:
# external: true
## For Xdebug profiler
# files:
Contents of your .env
### Documentation available at https://wodby.com/docs/stacks/drupal/local
### Changelog can be found at https://github.com/wodby/docker4drupal/releases
### Images tags format explained at https://github.com/wodby/docker4drupal#images-tags
### PROJECT SETTINGS
PROJECT_NAME=drupal
PROJECT_BASE_URL=drupal.docker.localhost
DB_NAME=drupal
DB_USER=postgres
DB_PASSWORD=postgres
DB_ROOT_PASSWORD=password
DB_HOST=postgres
DB_DRIVER=pgsql
### --- MARIADB ----
MARIADB_TAG=10.1-3.4.5
#MARIADB_TAG=10.3-3.4.5
#MARIADB_TAG=10.2-3.4.5
### --- VANILLA DRUPAL ----
#DRUPAL_TAG=8-4.12.15
#DRUPAL_TAG=7-4.12.15
### --- PHP ----
# Linux (uid 1000 gid 1000)
#PHP_TAG=7.2-dev-4.12.9
#PHP_TAG=7.3-dev-4.12.9
#PHP_TAG=7.1-dev-4.12.9
#PHP_TAG=5.6-dev-4.12.9
# macOS (uid 501 gid 20)
#PHP_TAG=7.3-dev-macos-4.12.9
#PHP_TAG=7.2-dev-macos-4.12.9
PHP_TAG=7.1-dev-macos-4.12.9
#PHP_TAG=5.6-dev-macos-4.12.9
### --- NGINX ----
NGINX_TAG=1.15-5.4.0
#NGINX_TAG=1.14-5.4.0
#NGINX_VHOST_PRESET=drupal8
NGINX_VHOST_PRESET=drupal7
#NGINX_VHOST_PRESET=drupal6
### --- SOLR ---
SOLR_CONFIG_SET="search_api_solr_8.x-2.7"
#SOLR_CONFIG_SET="search_api_solr_8.x-1.2"
#SOLR_CONFIG_SET="search_api_solr_7.x-1.14"
SOLR_TAG=7.7-3.1.1
#SOLR_TAG=7.6-3.1.1
#SOLR_TAG=7.5-3.1.1
#SOLR_TAG=6.6-3.1.1
#SOLR_TAG=5.5-3.1.1
### --- ELASTICSEARCH ---
ELASTICSEARCH_TAG=6.7-4.1.2
#ELASTICSEARCH_TAG=5.6-4.1.2
### --- KIBANA ---
KIBANA_TAG=6.7-4.1.1
#KIBANA_TAG=5.6-4.1.1
### --- REDIS ---
REDIS_TAG=4-3.0.6
#REDIS_TAG=5-3.0.6
### --- NODE ---
NODE_TAG=10-0.13.0
#NODE_TAG=8-0.13.0
#NODE_TAG=6-0.13.0
### --- VARNISH ---
VARNISH_TAG=4.1-4.2.7
#VARNISH_TAG=6.0-4.2.7
### --- POSTGRESQL ----
#POSTGRES_TAG=11-1.6.1
#POSTGRES_TAG=10-1.6.1
POSTGRES_TAG=9.6-1.6.1
#POSTGRES_TAG=9.5-1.6.1
#POSTGRES_TAG=9.4-1.6.1
### OTHERS
ADMINER_TAG=4-3.5.9
APACHE_TAG=2.4-4.0.6
ATHENAPDF_TAG=2.10.0
DRUPAL_NODE_TAG=1.0-2.0.0
MEMCACHED_TAG=1-2.2.2
OPENSMTPD_TAG=6.0-1.4.1
RSYSLOG_TAG=latest
WEBGRIND_TAG=1.5-1.9.9
XHPROF_TAG=1.3.9
Logs output docker-compose logs
Attaching to amg-ate_nginx, amg-ate_postgres, amg-ate_php, amg-ate_traefik, amg-ate_node, amg-ate_mailhog, amg-ate_portainer
amg-ate_postgres | LOG: database system was shut down at 2019-04-29 07:02:49 UTC
amg-ate_postgres | LOG: MultiXact member wraparound protections are now enabled
amg-ate_postgres | LOG: database system is ready to accept connections
amg-ate_postgres | LOG: autovacuum launcher started
amg-ate_php | [29-Apr-2019 07:03:00] NOTICE: fpm is running, pid 1
amg-ate_php | [29-Apr-2019 07:03:00] NOTICE: ready to handle connections
amg-ate_php | 172.22.0.7 - 29/Apr/2019:07:03:19 +0000 "GET /index.php" 500
amg-ate_php | 172.22.0.7 - 29/Apr/2019:07:05:01 +0000 "GET /index.php" 200
amg-ate_php | 172.22.0.7 - 29/Apr/2019:07:05:38 +0000 "POST /index.php" 200
amg-ate_php | 172.22.0.7 - 29/Apr/2019:07:06:16 +0000 "GET /index.php" 200
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: using the "epoll" event method
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: nginx/1.15.12
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: built by gcc 6.4.0 (Alpine 6.4.0)
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: OS: Linux 4.9.125-linuxkit
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: start worker processes
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: start worker process 44
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: start worker process 45
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: start worker process 46
amg-ate_nginx | 2019/04/29 07:03:03 [notice] 1#1: start worker process 47
amg-ate_nginx | 172.22.0.5 - - [29/Apr/2019:07:03:30 +0000] "GET /user/ HTTP/1.1" 500 3857 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36"
amg-ate_nginx | 172.22.0.5 - - [29/Apr/2019:07:05:17 +0000] "GET /user/ HTTP/1.1" 200 5946 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36"
amg-ate_nginx | 172.22.0.5 - - [29/Apr/2019:07:05:17 +0000] "GET /favicon.ico HTTP/1.1" 200 43 "http://amg-ate.docker.localhost:8000/user/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36"
amg-ate_nginx | 172.22.0.5 - - [29/Apr/2019:07:05:52 +0000] "POST /user/ HTTP/1.1" 200 6069 "http://amg-ate.docker.localhost:8000/user/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36"
amg-ate_nginx | 172.22.0.5 - - [29/Apr/2019:07:06:28 +0000] "GET /user/ HTTP/1.1" 200 5945 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36"
amg-ate_nginx | 172.22.0.5 - - [29/Apr/2019:07:06:29 +0000] "GET /favicon.ico HTTP/1.1" 200 43 "http://amg-ate.docker.localhost:8000/user/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36"
amg-ate_node | yarn install v1.13.0
amg-ate_node | [1/4] Resolving packages...
amg-ate_node | success Already up-to-date.
amg-ate_node | Done in 0.57s.
amg-ate_node | yarn run v1.13.0
amg-ate_node | $ gulp
amg-ate_node | [07:03:05] Using gulpfile /usr/src/app/sites/all/themes/AMG/gulpfile.js
amg-ate_node | [07:03:05] Starting 'default'...
amg-ate_node | [07:03:05] Starting 'styles'...
amg-ate_node | styles updated
amg-ate_node | [07:03:05] Finished 'styles' after 335 ms
amg-ate_node | [07:03:05] Starting 'watcher'...
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Using TOML configuration file /dev/null"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=warning msg="web provider configuration is deprecated, you should use these options : api, rest provider, ping and metrics"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Traefik version v1.7.11 built on 2019-04-26_08:42:33AM"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="\nStats collection is disabled.\nHelp us improve Traefik by turning this feature on :)\nMore details on: https://docs.traefik.io/basics/#collected-data\n"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Preparing server http &{Address::80 TLS:<nil> Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc00084a600} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Preparing server traefik &{Address::8080 TLS:<nil> Redirect:<nil> Auth:<nil> WhitelistSourceRange:[] WhiteList:<nil> Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc00084a640} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Starting provider configuration.ProviderAggregator {}"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Starting server on :80"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Starting server on :8080"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Starting provider *docker.Provider {\"Watch\":true,\"Filename\":\"\",\"Constraints\":null,\"Trace\":false,\"TemplateVersion\":2,\"DebugLogGeneratedTemplate\":false,\"Endpoint\":\"unix:///var/run/docker.sock\",\"Domain\":\"\",\"TLS\":null,\"ExposedByDefault\":true,\"UseBindPortIP\":false,\"SwarmMode\":false,\"Network\":\"\",\"SwarmModeRefreshSeconds\":15}"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Server configuration reloaded on :80"
amg-ate_traefik | time="2019-04-29T07:03:00Z" level=info msg="Server configuration reloaded on :8080"
amg-ate_traefik | time="2019-04-29T07:03:02Z" level=info msg="Server configuration reloaded on :80"
amg-ate_traefik | time="2019-04-29T07:03:02Z" level=info msg="Server configuration reloaded on :8080"
amg-ate_traefik | time="2019-04-29T07:03:04Z" level=info msg="Server configuration reloaded on :80"
amg-ate_traefik | time="2019-04-29T07:03:04Z" level=info msg="Server configuration reloaded on :8080"
amg-ate_portainer | 2019/04/29 07:02:59 Templates already registered inside the database. Skipping template import.
amg-ate_portainer | 2019/04/29 07:02:59 Instance already has defined endpoints. Skipping the endpoint defined via CLI.
amg-ate_portainer | 2019/04/29 07:02:59 Starting Portainer 1.20.2 on :9000
amg-ate_mailhog | [HTTP] Binding to address: 0.0.0.0:8025
amg-ate_mailhog | Creating API v1 with WebPath:
amg-ate_mailhog | 2019/04/29 07:03:00 Using in-memory storage
amg-ate_mailhog | 2019/04/29 07:03:00 [SMTP] Binding to address: 0.0.0.0:1025
amg-ate_mailhog | 2019/04/29 07:03:00 Serving under http://0.0.0.0:8025/
amg-ate_mailhog | Creating API v2 with WebPath:
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
amg-ate_mailhog | [APIv1] KEEPALIVE /api/v1/events
Perhaps you already have a volume managed by docker for your postgres container so it skips the init, see docker volume ls because it works fine for me (see below). You can add DEBUG=1 env var to postgres to see the details.
$ docker run --rm -ti -e POSTGRES_PASSWORD=1 -e DEBUG=1 -v /my/dir/with/sql/file:/docker-entrypoint-initdb.d wodby/postgres:9.6-1.6.1
+ [[ -z 1 ]]
+ [[ -z '' ]]
+ export POSTGRES_DB=postgres
+ POSTGRES_DB=postgres
+ mkdir -p /etc/postgresql/
+ gotpl /etc/gotpl/postgresql-9.6.conf.tpl
+ [[ -c == \m\a\k\e ]]
+ exec /usr/local/bin/docker-entrypoint.sh -c config_file=/etc/postgresql/postgresql.conf
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... sh: locale: not found
No usable system locales were found.
Use the option "--debug" to see details.
ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
waiting for server to start....LOG: database system was shut down at 2019-04-30 03:24:17 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
done
server started
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/pg.sql
CREATE TABLE
waiting for server to shut down....LOG: received fast shutdown request
LOG: aborting any active transactions
LOG: autovacuum launcher shutting down
LOG: shutting down
LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
LOG: database system was shut down at 2019-04-30 03:24:19 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
Hi there, sorry I might have not been very clear.
I can get the container to work and it pulls in the .sql data fine... But _only_ if I set the DB_USER (which is assigned to POSTGRES_USER in the docker-compose.yml file) to postgres.
The postgres user is expected in the .sql export file.
i.e. default settings in .env:
DB_NAME=drupal
DB_USER=drupal
DB_PASSWORD=drupal
DB_ROOT_PASSWORD=password
DB_HOST=mariadb
DB_DRIVER=mysql
Must be changed to:
DB_NAME=drupal
DB_USER=postgres
DB_PASSWORD=drupal
DB_ROOT_PASSWORD=password
DB_HOST=postgres
DB_DRIVER=pgsql
Then it works... In previous versions I could roll with the default settings for DB_USER.
It seems to be related to this https://github.com/docker-library/postgres/issues/41 — POSTGRES_USER must be set to postgres.
Running on MAC OSX Mojave 10.14.4.

Perhaps your .sql dump explicitly uses postgres user:
$ docker run --rm -ti -e POSTGRES_PASSWORD=test -e POSTGRES_USER=test -e DEBUG=1 -v /path/to/dir/with/sql/file:/docker-entrypoint-initdb.d wodby/postgres:9.6-1.6.1
+ [[ -z test ]]
+ [[ -z '' ]]
+ export POSTGRES_DB=test
+ POSTGRES_DB=test
+ mkdir -p /etc/postgresql/
+ gotpl /etc/gotpl/postgresql-9.6.conf.tpl
+ [[ -c == \m\a\k\e ]]
+ exec /usr/local/bin/docker-entrypoint.sh -c config_file=/etc/postgresql/postgresql.conf
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... sh: locale: not found
No usable system locales were found.
Use the option "--debug" to see details.
ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
waiting for server to start....LOG: database system was shut down at 2019-04-30 07:55:36 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
done
server started
CREATE DATABASE
/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/pg.sql
CREATE TABLE
waiting for server to shut down....LOG: received fast shutdown request
LOG: aborting any active transactions
LOG: autovacuum launcher shutting down
LOG: shutting down
LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
LOG: database system was shut down at 2019-04-30 07:55:38 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
^CLOG: received fast shutdown request
LOG: aborting any active transactions
LOG: autovacuum launcher shutting down
LOG: shutting down
LOG: database system is shut down
Yes that's correct — my .sql dump explicitly uses postgres user. I'm not sure how to go about changing that! It's a legacy Drupal 7 project that I support which uses PostgreSQL. Pretty much all my projects use MySQL!
All I know is that on previous version of the docker4drupal stack it worked without explicitly setting the POSTGRES_USER to postgres.
I thought I'd flag it up in case it was helpful for anyone else bumping into this issue :-)
Great stack BTW! Super useful.
Maybe we just didn't assign $DB_USED to $POSTGRES_USER before and it worked because postgres is the default user name.
Most helpful comment
Perhaps your
.sqldump explicitly usespostgresuser: