File tree Expand file tree Collapse file tree
apps/web-parser/server/tasks/yandex Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ async function getDataFromYandex(browser: Browser, url: string) {
8585 await page . locator ( '.rating-ranking-view' ) . click ( )
8686 await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) )
8787 // Click on second button in class "rating-ranking-view__popup"
88- await page . locator ( '.rating-ranking-view__popup-line' , { hasText : 'По новизне' } ) . click ( )
88+ const buttons = await page . $$ ( '.rating-ranking-view__popup-line' )
89+ await buttons [ 1 ] ?. click ( )
8990
9091 // Wait
9192 await new Promise ( ( resolve ) => setTimeout ( resolve , 1000 ) )
Original file line number Diff line number Diff line change 1- FROM node:22.17.1-alpine AS base
1+ FROM node:22.17.1-slim AS base
22ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
33ENV PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright
44
@@ -12,22 +12,20 @@ RUN npm install --ignore-scripts -g pnpm && \
1212 pnpm i --frozen-lockfile && \
1313 pnpm build --filter @roll-stack/web-parser
1414
15- RUN pnpm dlx playwright install --with-deps --only-shell
16-
1715# Production stage
1816FROM base AS production
19- RUN apk add --no-cache curl
2017WORKDIR /app
2118
19+ RUN npx playwright install chromium --with-deps --only-shell
20+
2221# Copy built artifacts from builder
2322COPY --from=builder /app/apps/web-parser/.output .
24- COPY --from=builder /opt/ms-playwright /opt/ms-playwright
2523COPY docker/web-parser/health-check.sh ./
2624
2725# Running as non-root is a security best practice
2826# Make the Health check script executable
29- RUN addgroup -S appgroup && \
30- adduser -S appuser -G appgroup && \
27+ RUN groupadd -r appgroup && \
28+ useradd -r -g appgroup appuser && \
3129 chmod +x ./health-check.sh
3230USER appuser
3331
You can’t perform that action at this time.
0 commit comments