diff --git a/Dockerfile b/Dockerfile index d3859fe..e90d74a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,11 +30,12 @@ FROM node:18-alpine WORKDIR /app # Create necessary directories and set permissions -RUN mkdir -p /app/uploads/wallpapers && \ - touch /app/database.sqlite && \ +RUN mkdir -p /app/uploads/wallpapers /app/database && \ + touch /app/database/database.sqlite && \ chown -R node:node /app && \ 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*.json ./ @@ -51,4 +52,4 @@ USER node EXPOSE 3000 # Start the application -CMD ["node", "dist/index.js"] \ No newline at end of file +CMD ["node", "dist/index.js"] diff --git a/backend/src/index.ts b/backend/src/index.ts index 19ed3f7..f028931 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -57,7 +57,7 @@ interface RSVP { async function connectToDatabase() { try { // 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({ filename: dbPath,