Skip to content

Commit d4f007b

Browse files
Change local docker-compose setup (#824)
Make a couple of changes to the local `docker-compose` setup: **Run local the postgres container as user `postgres`**: ``` So that the healthcheck can run as the `postgres` user and not add a connection failure error to the Postgres log when the health check attempts to connect as the `root` user. ``` **Edit healthcheck settings to avoid repeated health checks after the container has started**: ``` Set a `start_period` and a `start_interval` to ensure that the healthcheck quickly notices that Postgres is ready after startup. Thereafter, set the `interval` to 24h because we don't care about ongoing healthchecks in the local dev environment. ```
1 parent 2982cf7 commit d4f007b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
services:
22
db:
33
image: 'postgres:17'
4+
user: postgres
45
restart: always
56
environment:
67
- POSTGRES_USER=postgres
@@ -11,6 +12,7 @@ services:
1112
- /var/lib/postgresql/data
1213
healthcheck:
1314
test: "pg_isready -h localhost"
14-
interval: 200ms
15+
start_period: 30s
16+
start_interval: 100ms
17+
interval: 24h
1518
timeout: 5s
16-
retries: 10

0 commit comments

Comments
 (0)