fix(docker): use node:20-slim base image instead of unavailable Playwright image
All checks were successful
Deploy to Docker / deploy (push) Successful in 2m12s
All checks were successful
Deploy to Docker / deploy (push) Successful in 2m12s
The Playwright Docker image v1.58.2-noble doesn't exist on MCR, breaking the CI build. Switch to node:20-slim and install Playwright chromium at build time for resilience against future version mismatches. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,17 +1,22 @@
|
||||
FROM mcr.microsoft.com/playwright/javascript:v1.58.2-noble
|
||||
FROM node:20-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm ci --production 2>/dev/null || npm install --production
|
||||
|
||||
# Install Playwright browsers + OS dependencies (chromium only to save space)
|
||||
RUN npx playwright install --with-deps chromium
|
||||
|
||||
COPY src/ ./src/
|
||||
|
||||
# Create cache directory owned by pwuser (default user in playwright image)
|
||||
RUN mkdir -p /app/cache && chown -R pwuser:pwuser /app/cache
|
||||
# Create cache directory
|
||||
RUN mkdir -p /app/cache
|
||||
|
||||
EXPOSE 3001 3002
|
||||
|
||||
USER pwuser
|
||||
|
||||
CMD ["node", "src/index.js"]
|
||||
|
||||
Reference in New Issue
Block a user