fix: Add build output validation to Dockerfile.web

- Verify dist directory exists after build completes
- Provides better error messaging if build outputs are missing
- Prevents silent failures that result in empty COPY commands
This commit is contained in:
Stephanos A.
2026-06-02 23:01:43 +03:00
parent 25fc057ac7
commit 5645a95dd6

View File

@@ -33,6 +33,14 @@ RUN pnpm turbo build --filter="${TURBO_FILTER}..." || \
ls -la /app/${APP_PATH}/ 2>/dev/null || echo "App path does not exist" && \
exit 1)
# Verify build output exists before proceeding
RUN if [ ! -d "/app/${APP_PATH}/dist" ]; then \
echo "ERROR: Build output directory not found at /app/${APP_PATH}/dist"; \
echo "Contents of /app/${APP_PATH}:"; \
ls -la /app/${APP_PATH}/ 2>/dev/null || echo "Directory does not exist"; \
exit 1; \
fi
FROM nginx:alpine AS runner
ARG APP_PATH
COPY infrastructure/nginx/spa.conf /etc/nginx/conf.d/default.conf