Enhancement request: don't refer to initdb from git repository

Open
#561 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, postgresql
Domain
databases, devops

Research direction

Start with compose.yml and any other compose files in the repo, focusing on the initdb volume mount referenced in the issue. Check where the Postgres seed is consumed by the container startup and whether any scripts assume the seed file is a mounted git-path dependency. Update the compose/service setup so the seed is provisioned without that mount (and document the chosen flow), then run docker compose up to verify the local stack starts cleanly without the repository seed volume.

Written by the indexing model from the issue text.

Description

design needed enhancement

Is your enhancement request related to a problem? Please describe.

I wanted to have a simple Docker setup for local use that wasn't intended for development but for using DejaCode. Therefore I had no need for building a Docker container or having a build environment. I was looking for a simple Docker Compose file with the necessary containers that exist.

I was surprised by the explicit volume mount of the Postgresql database seed:
https://github.com/aboutcode-org/dejacode/blob/c3399c8056d05eb0fbff13604ae4b3e8229a3bc0/compose.yml#L12

In this way the Docker compose files have a dependency on this git repository. This mount is present in all Docker compose files in this repository.

In the setup I came up with, I finally added the database seed to get it running. https://codeberg.org/nicorikken/aboutcode-locally

I'm surprised of the additional complexity of managing this database seed in a container-based setup. I would have expected a more implicit setup.

What are the benefits of the requested enhancement?

If the database seed would have been managed from within the built containers, the docker-compose setup would be simpler and would need nothing more than a docker-compose.yml file or maybe an nginx config and environment file if they aren't embedded into the compose file.

Describe the solution you would like

I would expect Dejacode to manage the database seed. I see a few options:

  1. Ship the database seed within the container. This risks the database seed having become outdated.
  2. Download the database seed at boot. This risks the download being blocked by the network. A manual install could be documented.

Additional notes

None

Dominant language
Python
Stars
53
Forks
32
Avg merge
16h 44m
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/dejacode

All issues in aboutcode-org/dejacode

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.