fix docker builds but for real

main
Lea 2024-01-17 12:47:00 +01:00
parent 7e80f35846
commit a04867d4c7
Signed by: Lea
GPG Key ID: 1BAFFE8347019C42
3 changed files with 12 additions and 7 deletions

View File

@ -57,4 +57,4 @@ ENV HOSTNAME "0.0.0.0"
# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["node", "server.js"]
CMD ["node", "start"]

View File

@ -1,4 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
output: "standalone"
};
module.exports = nextConfig
module.exports = nextConfig;

View File

@ -2,11 +2,14 @@ import sqlite from "sqlite3";
import bcrypt from "bcryptjs";
const { CREDENTIALS_DB_PATH } = process.env;
if (!CREDENTIALS_DB_PATH) {
throw "$CREDENTIALS_DB_PATH not provided; unable to connect to database";
}
export const database = () => new sqlite.Database(CREDENTIALS_DB_PATH!);
export const database = () => {
if (!CREDENTIALS_DB_PATH) {
throw "$CREDENTIALS_DB_PATH not provided; unable to connect to database";
}
return new sqlite.Database(CREDENTIALS_DB_PATH!);
};
export function validateCredentials(email: string, password: string) {
const db = database();