Skip to content

Commit

Permalink
Moving TEFCA DB vars to docker compose (#2613)
Browse files Browse the repository at this point in the history
* Moving TEFCA DB vars to docker compose

* removing root user error message

* removing root user error message
  • Loading branch information
robertandremitchell authored Sep 24, 2024
1 parent 15c1de2 commit 092164b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
8 changes: 5 additions & 3 deletions containers/tefca-viewer/docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ services:
image: "postgres:alpine"
ports:
- "5432:5432"
env_file:
- "./tefca.env"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=pw
- POSTGRES_DB=tefca_db
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 20
Expand Down
11 changes: 6 additions & 5 deletions containers/tefca-viewer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ services:
image: "postgres:alpine"
ports:
- "5432:5432"
env_file:
- "./tefca.env"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=pw
- POSTGRES_DB=tefca_db
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 20
Expand All @@ -31,10 +33,9 @@ services:
dockerfile: ./containers/tefca-viewer/Dockerfile
ports:
- "3000:3000"
env_file:
- "./tefca.env"
environment:
- NODE_ENV=production
- DATABASE_URL=postgres://postgres:pw@db:5432/tefca_db
depends_on:
db:
condition: service_healthy
Expand Down
2 changes: 1 addition & 1 deletion containers/tefca-viewer/e2e/query_workflow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ test.describe("Test the user journey of a 'tester'", () => {
);

// Check that there are multiple rows in the table
await expect(page.locator("tbody").locator("tr")).toHaveCount(9);
await expect(page.locator("tbody").locator("tr")).toHaveCount(10);

// Click on the first patient's "View Record" button
await page.locator(':nth-match(:text("View Record"), 1)').click();
Expand Down
4 changes: 2 additions & 2 deletions containers/tefca-viewer/src/app/database-service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use server";
import { Pool, PoolConfig, QueryResultRow } from "pg";
import dotenv from "dotenv";
// import dotenv from "dotenv";
import { ValueSetItem, valueSetTypeToClincalServiceTypeMap } from "./constants";

const getQuerybyNameSQL = `
Expand All @@ -14,7 +14,7 @@ select q.query_name, q.id, qtv.valueset_id, vs.name as valueset_name, vs.author
`;

// Load environment variables from tefca.env and establish a Pool configuration
dotenv.config({ path: "tefca.env" });
// dotenv.config({ path: "tefca.env" });
const dbConfig: PoolConfig = {
connectionString: process.env.DATABASE_URL,
max: 10, // Maximum # of connections in the pool
Expand Down
7 changes: 0 additions & 7 deletions containers/tefca-viewer/tefca.env

This file was deleted.

0 comments on commit 092164b

Please sign in to comment.