File tree 4 files changed +29
-3
lines changed
4 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -134,3 +134,4 @@ build/
134
134
135
135
# Secrets
136
136
tokens.json
137
+ docker-compose.yml
Original file line number Diff line number Diff line change
1
+ version: "3.8"
2
+
3
+ services:
4
+ app:
5
+ image: jvik/elaway-gateway-api:latest
6
+ environment:
7
+ - ELAWAY_USER=
8
+ - ELAWAY_PASSWORD=
9
+ - ELAWAY_CLIENT_ID=
10
+ - ELAWAY_CLIENT_SECRET=
11
+ - CLIENT_ID=
12
+ - PORT=3000
13
+ ports:
14
+ - "3000:3000"
Original file line number Diff line number Diff line change 1
- # Use the official Node.js image as a base image
2
- FROM node:20.11.0
1
+ FROM node:slim
2
+
3
+ # We don't need the standalone Chromium
4
+ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
5
+
6
+ # Install Google Chrome Stable and fonts
7
+ # Note: this installs the necessary libs to make the browser work with Puppeteer.
8
+ RUN apt-get update && apt-get install gnupg wget -y && \
9
+ wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
10
+ sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
11
+ apt-get update && \
12
+ apt-get install google-chrome-stable -y --no-install-recommends && \
13
+ rm -rf /var/lib/apt/lists/*
3
14
4
15
# Set the working directory inside the container
5
16
WORKDIR /app
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ async function startOauth(): Promise<ElawayTokenResponse | null> {
151
151
let accessIdResponse : null | IdTokenResponse = null ;
152
152
const authUrl = `${ elawayAuthorizationUrl } ?response_type=code&client_id=${ encodeURIComponent ( clientId ) } &redirect_uri=${ encodeURIComponent ( redirectUri ) } &scope=${ encodeURIComponent ( oauthScope ) } &state=${ encodeURIComponent ( state ) } ` ;
153
153
154
- const browser = await puppeteer . launch ( { headless : true } ) ;
154
+ const browser = await puppeteer . launch ( { headless : true , args : [ '--no-sandbox' ] } ) ;
155
155
const page = await browser . newPage ( ) ;
156
156
157
157
try {
You can’t perform that action at this time.
0 commit comments