Skip to content

Missing Runtime API Server configuration Error while deploying to docker #15

@vigneshtdev

Description

@vigneshtdev

Here's my docker file

FROM node:14.16.0-buster as build-image


  # Include global arg in this stage of the build

  # Install aws-lambda-cpp build dependencies
  RUN apt-get update && \
      apt-get install -y \
      g++ \
      make \
      cmake \
      unzip \
      libcurl4-openssl-dev

  RUN apt-get install -y libwoff1 \
                           libopus0 \
                           libwebp6 \
                           libwebpdemux2 \
                           libenchant1c2a \
                           libgudev-1.0-0 \
                           libsecret-1-0 \
                           libhyphen0 \
                           libgdk-pixbuf2.0-0 \
                           libegl1 \
                           libnotify4 \
                           libxslt1.1 \
                           libevent-2.1-6 \
                           libgles2 \
                           libgl1 \
                           libvpx5 \
                           # for chromium
                           libnss3 \
                           libxss1 \
                           libasound2 \
                           # for firefox
                           libdbus-glib-1-2 \
                           libxt6


  COPY app.js package.json /var/task/

  WORKDIR /var/task

  RUN npm install

  ENTRYPOINT ["/usr/local/bin/npx", "aws-lambda-ric"]
  CMD [ "app.handler" ]

app.js

"use strict";

  const { firefox } = require('playwright-firefox');

  const run = async () => {
      const browser = await firefox.launch({headless: true},);
      console.log(browser.version);
      const page = await browser.newPage();
      await page.goto('https://google.com/');
      //new S3().upload(await page.screenshot({ path: `example.png` }));
      await browser.close();
  }


  exports.handler = async (event, context) => {
      console.log(event);

      console.log(process.platform);
      await run();
      return "Success";
  };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions