So, I have a project creating dockers with this structure:
DockerDev - docker-compose.yaml - d-php - Dockerfile - scripts-apache - d-postgresql - Dockerfile - scripts - dev_data_setup.sql - logs - pgdata - www
PHP, Redis, ElasticSearch are fine. But Postgresql does not start dev_data_setup.sql with any of the various / dockes -entrypoint-initdb.d solutions that I found (volume, ADD, COPY, etc.). I tried to run and sh script and nothing.
Could you see this docker-compose and Dockerfile and help me? Thanks
Dockerfile:
FROM postgres:latest ADD ./scripts/dev_data_setup.sql /docker-entrypoint-initdb.d
docker-compose.yaml:
version: '2' services: php: build: ./d-php/ hostname: www.domain.com ports: - "80:80" volumes: - ./www:/var/www/html - ./d-php/scripts-apache2/apache2.conf:/etc/apache2/apache2.conf - ./d-php/scripts-apache2/web.conf:/etc/apache2/sites-enabled/web.conf - ./d-php/scripts-apache2/webservice.conf:/etc/apache2/sites-enabled/webservice.conf - ./logs:/var/log/apache2 links: - db - redis - elasticsearch db: build: ./d-postgresql/ volumes: - ./pgdata:/pgdata environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - PGDATA=/pgdata redis: image: redis:latest elasticsearch: image: elasticsearch:2.4.1
docker postgresql docker-compose
Rodrigo Saraiva
source share