-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.debug
More file actions
58 lines (44 loc) · 1.62 KB
/
Dockerfile.debug
File metadata and controls
58 lines (44 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# AI Act Navigator - Debug Dockerfile
FROM node:20-alpine
# Cache bust argument to force rebuild
ARG CACHE_BUST=default
RUN echo "Cache bust: $CACHE_BUST"
WORKDIR /app
# Install system dependencies
RUN apk add --no-cache curl wget
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Force cache invalidation with timestamp
RUN echo "Build timestamp: $(date)" > /tmp/build-timestamp
# Copy source code
COPY . .
# Clean any existing build
RUN rm -rf dist/
# Build frontend only (not the server bundle)
RUN npm run build:frontend
# Verify build contains our modifications
RUN echo "Verifying build..." && \
ls -la dist/public/assets/ && \
echo "Build verification complete"
# Expose port
EXPOSE 5000
# Set environment
ENV NODE_ENV=production
ENV PORT=5000
# Add debug script that uses tsx directly
RUN echo '#!/bin/sh' > /app/debug.sh && \
echo 'echo "🔍 Debug Information:"' >> /app/debug.sh && \
echo 'echo "Node version: $(node --version)"' >> /app/debug.sh && \
echo 'echo "NPM version: $(npm --version)"' >> /app/debug.sh && \
echo 'echo "Working directory: $(pwd)"' >> /app/debug.sh && \
echo 'echo "Files in dist:"' >> /app/debug.sh && \
echo 'ls -la dist/ || echo "No dist directory"' >> /app/debug.sh && \
echo 'echo "Environment variables:"' >> /app/debug.sh && \
echo 'env | grep -E "(NODE_ENV|PORT|DATABASE_URL)" || echo "No relevant env vars"' >> /app/debug.sh && \
echo 'echo "Starting application with tsx..."' >> /app/debug.sh && \
echo 'npx tsx server/index.ts' >> /app/debug.sh && \
chmod +x /app/debug.sh
# Start with debug
CMD ["/app/debug.sh"]