Fix content and URL in README
This commit is contained in:
@@ -15,13 +15,24 @@ RUN npm rebuild better-sqlite3
|
||||
COPY shared ./shared
|
||||
COPY server ./server
|
||||
COPY site-context.json ./
|
||||
|
||||
# Copy content twice:
|
||||
# /app/content — the live directory (will be overlaid by a volume mount)
|
||||
# /app/content-seed — preserved in the image, used to seed empty volumes
|
||||
COPY content ./content
|
||||
COPY content ./content-seed
|
||||
|
||||
COPY config ./config
|
||||
|
||||
# Entrypoint seeds the volume on first deploy
|
||||
COPY server/entrypoint.sh /app/entrypoint.sh
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
|
||||
WORKDIR /app/server
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV REPO_ROOT=/app
|
||||
EXPOSE 3001
|
||||
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
CMD ["npx", "tsx", "src/index.ts"]
|
||||
|
||||
19
server/entrypoint.sh
Normal file
19
server/entrypoint.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Seed content into the volume if it's empty (first deploy).
|
||||
# The Dockerfile copies seed content to /app/content-seed.
|
||||
# The volume is mounted at /app/content and starts empty.
|
||||
SEED_DIR="/app/content-seed"
|
||||
CONTENT_DIR="/app/content"
|
||||
|
||||
if [ -d "$SEED_DIR" ] && [ -d "$CONTENT_DIR" ]; then
|
||||
# Check if sections directory is missing or empty
|
||||
if [ ! -d "$CONTENT_DIR/sections" ] || [ -z "$(ls -A "$CONTENT_DIR/sections" 2>/dev/null)" ]; then
|
||||
echo "Seeding content from $SEED_DIR into $CONTENT_DIR..."
|
||||
cp -rn "$SEED_DIR/"* "$CONTENT_DIR/" 2>/dev/null || true
|
||||
echo "Content seeded."
|
||||
fi
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user