Rearranged how the sqlite database is stored for better volume mounting

This commit is contained in:
Ryderjj89
2025-06-04 17:39:15 -04:00
parent eee0422579
commit afc09aed77
2 changed files with 6 additions and 5 deletions

View File

@@ -30,11 +30,12 @@ FROM node:18-alpine
WORKDIR /app WORKDIR /app
# Create necessary directories and set permissions # Create necessary directories and set permissions
RUN mkdir -p /app/uploads/wallpapers && \ RUN mkdir -p /app/uploads/wallpapers /app/database && \
touch /app/database.sqlite && \ touch /app/database/database.sqlite && \
chown -R node:node /app && \ chown -R node:node /app && \
chmod 755 /app/uploads && \ chmod 755 /app/uploads && \
chmod 644 /app/database.sqlite chmod 755 /app/database && \
chmod 644 /app/database/database.sqlite
# Copy backend package files and install dependencies # Copy backend package files and install dependencies
COPY backend/package*.json ./ COPY backend/package*.json ./

View File

@@ -57,7 +57,7 @@ interface RSVP {
async function connectToDatabase() { async function connectToDatabase() {
try { try {
// Database file will be in the app directory // Database file will be in the app directory
const dbPath = path.join(__dirname, '../database.sqlite'); const dbPath = path.join(__dirname, '../database/database.sqlite');
db = await open({ db = await open({
filename: dbPath, filename: dbPath,