Skip to content

Commit 080b9a0

Browse files
committed
Speed up postgresql container without initing everytime
1 parent f54fee9 commit 080b9a0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: Speed up postgresql container without initing everytime
3+
date: 2024-10-24T09:10:00+08:00
4+
categories:
5+
- tech
6+
tags:
7+
- postgresql
8+
- container
9+
- podman
10+
---
11+
12+
A newly created postgresql container will do a following steps. They are quite time consuming in integration testing and add some unpredictable factor. If a integration testing will clean up tables and data, volumes can be used to speed up postgresql container.
13+
14+
* pg_ctl -D /var/lib/postgresql/data -l logfile start
15+
* initdb
16+
* stop postgresql and start again
17+
18+
19+
There might be one issue, do I need to maintain the same credential? need to further explore on this. So far my manully created container bind-mounted to the same volumes can be accessed and no tables in it after running integration test.

0 commit comments

Comments
 (0)