Whatever the data happens to be, the setup routine should include some way of getting it loaded into the database at the appropriate time.

      My preference would be to add a file of SQL statements to the docker/ directory as a standalone file, then have it loadable by a recipe in the Makefile once the stack was running successfully.

      Other possible approaches, with caveats:

      You can add initialization scripts to the database container at build time, to execute the first time the container runs without a Postgres data directory. (E.g., docker/postgis_init.sh in the Library Registry repo). However, the actual database structure does not exist until the first time the Flask application is initialized, so loading that way would mean also writing the full DDL out at the same time. Not a great solution, since it could get out of sync with subsequent migrations.

      An actual database migration is a possibility, but I'm leery of adding something that could accidentally get run by a prod instance.

       

       

            NickBallenger Nick Ballenger (Inactive)
            NickBallenger Nick Ballenger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: