From 5783818aa1446ebb3e5a77f32dd57c426a6f935b Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 2 Nov 2024 00:22:57 +0530 Subject: [PATCH] feat: setup svfb --- server/Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server/Dockerfile b/server/Dockerfile index f108bc11..4ff94c03 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,4 +1,3 @@ -# Use Node.js with Ubuntu instead of Alpine for better Playwright support FROM mcr.microsoft.com/playwright:v1.40.0-jammy # Set working directory @@ -11,15 +10,22 @@ COPY src ./src COPY server ./server COPY tsconfig.json ./ COPY server/tsconfig.json ./server/ +COPY server/start.sh ./ # Install dependencies RUN npm install # Install Playwright browsers and dependencies -RUN npx playwright install --with-deps chromium firefox webkit +RUN npx playwright install --with-deps chromium + +# Install xvfb for display support +RUN apt-get update && apt-get install -y xvfb + +# Make the script executable +RUN chmod +x ./start.sh # Expose the backend port EXPOSE 8080 -# Start the backend using the server script -CMD ["npm", "run", "server"] \ No newline at end of file +# Start the backend using the start script +CMD ["./start.sh"] \ No newline at end of file