Fix database path and prisma.config

This commit is contained in:
2026-03-16 13:54:21 +01:00
parent 00e6407633
commit 8ad9afc79b
6 changed files with 9 additions and 5 deletions

View File

@@ -75,6 +75,7 @@ WORKDIR /opt/app/backend
COPY --from=backend-builder /opt/app/backend/node_modules ./node_modules
COPY --from=backend-builder /opt/app/backend/dist ./dist
COPY --from=backend-builder /opt/app/backend/prisma ./prisma
COPY --from=backend-builder /opt/app/backend/prisma.config.ts ./prisma.config.ts
COPY --from=backend-builder /opt/app/backend/package.json ./
COPY --from=backend-builder /opt/app/backend/tsconfig.json ./

View File

@@ -2,10 +2,13 @@ import "dotenv/config";
import { defineConfig } from "prisma/config";
const DATABASE_URL =
process.env.DATABASE_URL || "file:../data/swiss-datashare.db?connection_limit=1";
process.env.DATABASE_URL || "file:./data/swiss-datashare.db";
export default defineConfig({
schema: "prisma/schema.prisma",
migrations: {
seed: "ts-node prisma/seed/config.seed.ts",
},
datasource: {
url: DATABASE_URL,
},

View File

@@ -1 +1 @@
DATABASE_URL="file:../data/swiss-datashare.db?connection_limit=1"
DATABASE_URL="file:./data/swiss-datashare.db"

View File

@@ -431,7 +431,7 @@ const prisma = new PrismaClient({
adapter: new PrismaBetterSqlite3({
url:
process.env.DATABASE_URL ||
"file:../data/swiss-datashare.db?connection_limit=1",
"file:./data/swiss-datashare.db",
}),
});

View File

@@ -6,7 +6,7 @@ export const DATA_DIRECTORY = process.env.DATA_DIRECTORY || "./data";
export const SHARE_DIRECTORY = `${DATA_DIRECTORY}/uploads/shares`;
export const DATABASE_URL =
process.env.DATABASE_URL ||
"file:../data/swiss-datashare.db?connection_limit=1";
"file:./data/swiss-datashare.db";
export const CLAMAV_HOST =
process.env.CLAMAV_HOST ||
(process.env.NODE_ENV == "docker" ? "clamav" : "127.0.0.1");

View File

@@ -31,7 +31,7 @@ For installation specific configuration, you can use environment variables. The
| Variable | Default Value | Description |
| ---------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `BACKEND_PORT` | `8080` | The port on which the backend listens. |
| `DATABASE_URL` | `file:../data/swiss-datashare.db?connection_limit=1` | The URL of the SQLite database. |
| `DATABASE_URL` | `file:./data/swiss-datashare.db` | The URL of the SQLite database. |
| `DATA_DIRECTORY` | `./data` | The directory where data is stored. |
| `CONFIG_FILE` | `../config.yaml` | Path to the configuration file |
| `CLAMAV_HOST` | `127.0.0.1` or `clamav` when running with Docker/Podman | The IP address of the ClamAV server. See the [ClamAV docs](integrations.md#clamav) for more information. |