Trying to understand some Dockerfiles

I’m trying to understand what’s what in the Dockerfiles. One thing I haven’t understood is where the users.sqlite database file is created, or copied into the container. Looking at gramps-web-api/Dockerfile, I see

RUN mkdir /app/db && mkdir /app/media && mkdir /app/indexdir && mkdir /app/users

where the /app/users directory is created which will hold the database, and then in gramps-web-api/docker-entrypoint.sh we have

python3 -m gramps_webapi --config /app/config/config.cfg user migrate

which runs migrations on the user database, which must presumably be there by this point … but I can’t immediately see with COPY or RUN (or other) command in Dockerfile creates the database in the first place. Can anyone tell me what I’m missing?

Relevant lines of code:

This uses Flask-SQLAlchemy, see the docs there for details of how this works.

1 Like

Thanks for those pointers. I also see gramps-web/Dockerfile is

FROM dmstraub/gramps-webapi:latest
COPY dist /app/static
LABEL org.opencontainers.image.source="https://github.com/gramps-project/gramps-web"

I don’t know how that base image is built, but the COPY command seems to be copying rollup-built front-end files to the container. I can’t see any corresponding commands that build them in gramps-web-api/Dockerfile or gramps-web-api/Dockerfile.base - where should I be looking, please?

Look at .github in gramps-web

1 Like