From e6def646d6d9c8bde3054e5668a73ce83ffa1241 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Sat, 18 Jan 2025 01:28:48 +0100 Subject: [PATCH] fix: add missing dockerfile deps --- Dockerfile | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7077090..36905bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,31 @@ -FROM denoland/deno:alpine-2.1.4 +FROM gcr.io/distroless/base-debian11 ENV DATA_DIR=/app/data +ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 WORKDIR /app COPY . . -RUN apk add curl libstdc++ gtk+3.0 alsa-lib &&\ - deno run -A npm:playwright install firefox &&\ - deno install --allow-import --allow-ffi --allow-scripts=npm:sharp@0.33.5-rc.1 -e main.ts &&\ - sed -i -e 's/"deno"/"no-deno"/' node_modules/@libsql/client/package.json &&\ - mkdir -p $DATA_DIR - -RUN deno task build +# Install necessary libraries and dependencies for Playwright and your application +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + libstdc++6 \ + libgtk-3-0 \ + libnss3 \ + libxss1 \ + libasound2 \ + fonts-liberation \ + && curl -fsSL https://deno.land/x/install/install.sh | sh \ + && /root/.deno/bin/deno run -A npm:playwright install firefox \ + && /root/.deno/bin/deno install --allow-import --allow-ffi --allow-scripts=npm:sharp@0.33.5-rc.1 -e main.ts \ + && sed -i -e 's/"deno"/"no-deno"/' node_modules/@libsql/client/package.json \ + && mkdir -p $DATA_DIR \ + && rm -rf /var/lib/apt/lists/* +# Expose port 8000 for the application EXPOSE 8000 -CMD ["run", "-A", "main.ts"] +# Use the Deno binary from the installed path to start the app +CMD ["/root/.deno/bin/deno", "run", "-A", "main.ts"] +