diff --git a/Dockerfile b/Dockerfile index e9bd42a..8ead542 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,13 @@ RUN npm run build -- --configuration production # ===== Stage 2: Serve static files with Nginx (app service) ===== FROM nginx:alpine +# Install curl for healthcheck (nginx:alpine doesn't have wget/curl by default) +RUN apk add --no-cache curl + # Remove default Nginx files RUN rm -rf /usr/share/nginx/html/* -# Copy built Angular app (updated for Angular 17+ default output) +# Copy built Angular app COPY --from=builder /app/dist/niayesh-hospital/browser /usr/share/nginx/html # Copy app-specific Nginx config for SPA routing diff --git a/docker-compose.yml b/docker-compose.yml index a5cfde4..13ac7ec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: expose: - "80" healthcheck: - test: ["CMD", "wget", "--spider", "http://localhost:80"] + test: ["CMD", "curl", "-f", "http://localhost:80"] # Use curl (now installed) for reliable check; -f fails on non-200 interval: 30s timeout: 10s retries: 3