fix: Add /app/static directory, STATIC_PATH env var, and static volume declaration
This commit is contained in:
@@ -40,8 +40,8 @@ COPY server/ ./server/
|
||||
# Copy built frontend from previous stage
|
||||
COPY --from=frontend-builder /app/client/dist ./client/dist
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /app/data /app/uploads
|
||||
# Create necessary directories (including static for branding assets)
|
||||
RUN mkdir -p /app/data /app/uploads /app/static
|
||||
|
||||
# Initialize database schema on build
|
||||
RUN node server/db/init.js || true
|
||||
@@ -51,16 +51,17 @@ ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
ENV DB_PATH=/app/data/breedr.db
|
||||
ENV UPLOAD_PATH=/app/uploads
|
||||
ENV STATIC_PATH=/app/static
|
||||
|
||||
# Expose application port
|
||||
EXPOSE 3000
|
||||
|
||||
# Set up volumes for persistent data
|
||||
VOLUME ["/app/data", "/app/uploads"]
|
||||
VOLUME ["/app/data", "/app/uploads", "/app/static"]
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
CMD node -e "require('http').get('http://localhost:3000/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
|
||||
|
||||
# Start the application
|
||||
CMD ["node", "server/index.js"]
|
||||
CMD ["node", "server/index.js"]
|
||||
|
||||
Reference in New Issue
Block a user