Public Access
1
0

fix: update server.js

This commit is contained in:
2025-09-01 17:58:20 -04:00
parent 87c304f0df
commit 6d8ac07592
2 changed files with 3 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ RUN apk add --no-cache su-exec
# Using --chown ensures the non-root user owns the files.
COPY --from=builder --chown=node:node /app/node_modules ./node_modules
COPY --from=builder --chown=node:node /app/package.json ./package.json
COPY --from=builder --chown=node:node /app/src/server.js .
COPY --from=builder --chown=node:node /app/server.js .
COPY --from=builder --chown=node:node /app/_site ./_site
# The _data directory is handled by the volume, but we copy it so the volume can be pre-populated on first run.
COPY --from=builder --chown=node:node /app/src/_data/ ./_data/

View File

@@ -40,8 +40,8 @@ const apiLimiter = rateLimit({
app.use('/api/', apiLimiter);
// Path to the file where metadata counts will be stored
const dbPath = path.join(__dirname, '_data', 'views.json');
const likesDbPath = path.join(__dirname, '_data', 'likes.json');
const dbPath = path.join(__dirname, 'src/_data', 'views.json');
const likesDbPath = path.join(__dirname, 'src/_data', 'likes.json');
// Ensure the data directory and the .json files exist
fs.ensureFileSync(dbPath);