Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,22 @@ docker compose up
```sh
http://localhost:4000
```
#### Troubleshooting login issues

If signup or login fails and database logs show an error like:

relation "users" does not exist

This usually means the Postgres init script did not run on first startup.

Fix:
1. Stop the containers
2. Delete the folder imageConfigs/postgres/docketeerdb
3. Run docker compose up again

This forces Postgres to rerun init.sql and create the required tables.

Note: There is no default user. You must sign up first.

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
ports:
- '5432:5432'
volumes:
- ./imageConfigs/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- ./imageConfigs/postgres/docketeerdb:/var/lib/postgresql/data/

environment:
Expand Down
14 changes: 7 additions & 7 deletions imageConfigs/postgres/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE users (
mem_threshold INTEGER DEFAULT 80,
cpu_threshold INTEGER DEFAULT 80,
container_stops BOOLEAN DEFAULT true,
PRIMARY KEY (_id),
PRIMARY KEY (_id)
) WITH (
OIDS = FALSE
);
Expand All @@ -30,12 +30,12 @@ CREATE TABLE containers (
CONSTRAINT unique_id UNIQUE(id)
);

-- CREATE TABLE notification_settings (
-- id SERIAL PRIMARY KEY,
-- metric_name TEXT NOT NULL,
-- triggering_value INT,
-- CONSTRAINT unique_name UNIQUE(metric_name)
-- );
CREATE TABLE notification_settings (
id SERIAL PRIMARY KEY,
metric_name TEXT NOT NULL,
triggering_value INT,
CONSTRAINT unique_name UNIQUE(metric_name)
);

CREATE TABLE container_settings (
container_id TEXT REFERENCES containers(id),
Expand Down