File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
FROM oven/bun:1.1.29
2
+
3
+ RUN mkdir -p /etc/ssl/certs/
4
+ RUN echo "$PGCERT" > /etc/ssl/certs/postgres.crt
5
+ RUN chmod 600 /etc/ssl/certs/postgres.crt
6
+ ENV PGCERT_PATH=/etc/ssl/certs/postgres.crt
7
+
2
8
WORKDIR /app
3
9
COPY package.json bun.lockb ./
4
10
RUN bun install --production
5
11
COPY . .
6
12
RUN bun --bun run build
7
- CMD [ "bun" , "run" , ".output/server/index.mjs" ]
13
+ CMD [ "bun" , "run" , ".output/server/index.mjs" ]
Original file line number Diff line number Diff line change 1
1
import { drizzle } from 'drizzle-orm/node-postgres' ;
2
2
import { Pool } from 'pg' ;
3
+ import fs from 'node:fs' ;
3
4
4
5
export const pool = new Pool ( {
5
6
user : process . env . PGUSER ,
6
7
host : process . env . PGHOST ,
7
8
database : process . env . PGDB ,
8
9
password : process . env . PGPASSWORD ,
9
10
port : + ( process . env . PGPORT || 5432 ) ,
10
- ssl : true
11
+ ssl : {
12
+ rejectUnauthorized : true ,
13
+ ca : fs . readFileSync ( process . env . PGCERT_PATH || '' ) . toString ( )
14
+ }
11
15
} ) ;
12
16
13
17
export const db = drizzle ( pool ) ;
You can’t perform that action at this time.
0 commit comments