OHDSI / Broadsea-Atlasdb

A Postgresql database in a Docker container for OHDSI Atlas/WebAPI
Apache License 2.0
1 stars 4 forks source link

broadsea-atlasdb: Docker volume does not let initialization scripts to run. #7

Closed SukruHan closed 3 weeks ago

SukruHan commented 6 months ago

Hi,

In the docker-compose.yml, because of following lines:

 volumes:
     - atlasdb-postgres-data:/var/lib/postgresql/data
     - ./100_populate_source_source_daimon.sql:/docker-entrypoint-initdb.d/100_populate_source_source_daimon.sql:ro

I receive the skipping initialization warning, which leads ./100_populate_source_source_daimon.sql:/docker-entrypoint-initdb.d/100_populate_source_source_daimon.sql:ro script to not to run.

image

Linked issue: https://stackoverflow.com/questions/59715622/docker-compose-and-create-db-in-postgres-on-init https://registry.hub.docker.com/_/postgres/

I have checked the solutions and applied could not resolve it. Any recommendations?

leeevans commented 3 weeks ago

@SukruHan

The scripts are only executed when the atlasdb Docker container is started for the first time. Subsequently the Docker volume retains the data so there is no need to run the scripts again.

If you are sure that you want to start over with the initial state of the atlasdb and rerun the scripts then you can remove the docker volume: (note this will remove any database inserts/updates you may have previously applied to the database! This command cannot be undone!) docker volume rm atlasdb-postgres-data