fix: mount volume at correct path so database survives updates
Build and Deploy / Build & Push (push) Successful in 1m7s
Build and Deploy / Build & Push (push) Successful in 1m7s
WORKDIR is /app/backend so the DB lands at /app/backend/data/parks.db, but the volume was mounted at /app/data — a different directory. The DB lived in the container's ephemeral layer and was wiped on every pull. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -51,8 +51,8 @@ COPY --chown=nextjs:nodejs backend/package.json ./backend/package.json
|
|||||||
COPY --chown=nextjs:nodejs backend/tsconfig.json ./backend/tsconfig.json
|
COPY --chown=nextjs:nodejs backend/tsconfig.json ./backend/tsconfig.json
|
||||||
COPY --chown=nextjs:nodejs lib ./lib
|
COPY --chown=nextjs:nodejs lib ./lib
|
||||||
|
|
||||||
RUN mkdir -p /app/data && chown nextjs:nodejs /app/data
|
RUN mkdir -p /app/backend/data && chown nextjs:nodejs /app/backend/data
|
||||||
VOLUME ["/app/data"]
|
VOLUME ["/app/backend/data"]
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "3001:3001"
|
- "3001:3001"
|
||||||
volumes:
|
volumes:
|
||||||
- park_data:/app/data
|
- park_data:/app/backend/data
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- TZ=America/New_York
|
- TZ=America/New_York
|
||||||
|
|||||||
Reference in New Issue
Block a user