ChrisRichardMiles / ledger

0 stars 0 forks source link

Set up Dockerfile to create PostgreSQL database and table #3

Closed ChrisRichardMiles closed 5 months ago

ChrisRichardMiles commented 5 months ago

Description: As part of the backend setup for our General Ledger system, we need to configure our Dockerfile to include a PostgreSQL database and initialize it with a table that matches the schema required for our ledger entries. Additionally, we want to prepopulate the table with three initial entries to facilitate testing and development.

To do:

Acceptance criteria:

Prepopulated entries:

  1. Entry ID: 1, Date: 2024-05-10, Account Name: Sales, Entry Type: Debit, Amount: 5000.00 USD, Description: Sale of product A
  2. Entry ID: 2, Date: 2024-05-12, Account Name: Expenses, Entry Type: Credit, Amount: 1500.00 USD, Description: Office supplies purchase
  3. Entry ID: 3, Date: 2024-05-15, Account Name: Accounts Receivable, Entry Type: Debit, Amount: 3000.00 USD, Description: Invoice payment received
ChrisRichardMiles commented 5 months ago

I couldn't do it with a dockerfile, but i solved it with a run.sh file in the database directory. Running bash run.sh from the root will now create 2 containers, one running the frontend app and one running the database. It will also print and show that the database was created.

ChrisRichardMiles commented 5 months ago

close