Skip to content

Commit a23acc9

Browse files
authored
chore: node slim (#11)
* chore: node slim * chore: fix version
1 parent 43dd52f commit a23acc9

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

apps/web-parser/server/tasks/yandex/update-data.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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))

docker/web-parser/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.17.1-alpine AS base
1+
FROM node:22.17.1-slim AS base
22
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
33
ENV 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
1816
FROM base AS production
19-
RUN apk add --no-cache curl
2017
WORKDIR /app
2118

19+
RUN npx playwright install chromium --with-deps --only-shell
20+
2221
# Copy built artifacts from builder
2322
COPY --from=builder /app/apps/web-parser/.output .
24-
COPY --from=builder /opt/ms-playwright /opt/ms-playwright
2523
COPY 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
3230
USER appuser
3331

0 commit comments

Comments
 (0)