| 15 | import { validUniqueServerAppName } from "./project"; |
| 16 | |
| 17 | export function getMountPath(dockerImage: string): string { |
| 18 | const versionMatch = dockerImage.match(/postgres:(\d+)/); |
| 19 | |
| 20 | if (versionMatch?.[1]) { |
| 21 | const version = Number.parseInt(versionMatch[1], 10); |
| 22 | if (version >= 18) { |
| 23 | // PostgreSQL 18+ uses /var/lib/postgresql/{version}/docker as the default PGDATA |
| 24 | return `/var/lib/postgresql/${version}/docker`; |
| 25 | } |
| 26 | } |
| 27 | return "/var/lib/postgresql/data"; |
| 28 | } |
| 29 | |
| 30 | export type Postgres = typeof postgres.$inferSelect; |
| 31 | |