Spaces:
Paused
Paused
Mohammed Foud commited on
Commit ·
35eb7b8
1
Parent(s): 7a2f93a
all
Browse files- Dockerfile +7 -6
- src/bots/services/VirtualNumberService.ts +4 -4
- src/webook/main.ts +7 -7
Dockerfile
CHANGED
|
@@ -4,20 +4,21 @@ FROM node:22.13.1-slim
|
|
| 4 |
# Set the working directory inside the container
|
| 5 |
WORKDIR /usr/src/app
|
| 6 |
|
| 7 |
-
# Install pnpm globally
|
| 8 |
RUN npm install -g pnpm
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
# Copy package.json and pnpm-lock.yaml
|
| 11 |
-
COPY package.json pnpm-lock.yaml* ./
|
| 12 |
|
| 13 |
-
# Install dependencies
|
| 14 |
RUN pnpm install --frozen-lockfile
|
| 15 |
-
|
| 16 |
-
# Install Playwright browsers
|
| 17 |
RUN pnpm exec playwright install --with-deps
|
| 18 |
|
| 19 |
# Copy the rest of the application code
|
| 20 |
-
COPY . .
|
| 21 |
|
| 22 |
# Build the TypeScript project
|
| 23 |
RUN pnpm run build
|
|
|
|
| 4 |
# Set the working directory inside the container
|
| 5 |
WORKDIR /usr/src/app
|
| 6 |
|
| 7 |
+
# Install pnpm globally as root
|
| 8 |
RUN npm install -g pnpm
|
| 9 |
|
| 10 |
+
# Switch to node user for everything else
|
| 11 |
+
USER node
|
| 12 |
+
|
| 13 |
# Copy package.json and pnpm-lock.yaml
|
| 14 |
+
COPY --chown=node:node package.json pnpm-lock.yaml* ./
|
| 15 |
|
| 16 |
+
# Install dependencies and browsers as node user
|
| 17 |
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
|
| 18 |
RUN pnpm exec playwright install --with-deps
|
| 19 |
|
| 20 |
# Copy the rest of the application code
|
| 21 |
+
COPY --chown=node:node . .
|
| 22 |
|
| 23 |
# Build the TypeScript project
|
| 24 |
RUN pnpm run build
|
src/bots/services/VirtualNumberService.ts
CHANGED
|
@@ -42,10 +42,10 @@ export class VirtualNumberService {
|
|
| 42 |
private baseUrl: string = 'https://5sim.net/v1';
|
| 43 |
|
| 44 |
private constructor() {
|
| 45 |
-
this.apiKey = process.env.FIVESIM_API_KEY || '';
|
| 46 |
-
if (!this.apiKey) {
|
| 47 |
-
|
| 48 |
-
}
|
| 49 |
}
|
| 50 |
|
| 51 |
public static getInstance(): VirtualNumberService {
|
|
|
|
| 42 |
private baseUrl: string = 'https://5sim.net/v1';
|
| 43 |
|
| 44 |
private constructor() {
|
| 45 |
+
// this.apiKey = process.env.FIVESIM_API_KEY || '';
|
| 46 |
+
// if (!this.apiKey) {
|
| 47 |
+
// logger.error('5sim API key not found in environment variables');
|
| 48 |
+
// }
|
| 49 |
}
|
| 50 |
|
| 51 |
public static getInstance(): VirtualNumberService {
|
src/webook/main.ts
CHANGED
|
@@ -13,11 +13,11 @@ export async function main() {
|
|
| 13 |
process.exit(1);
|
| 14 |
}
|
| 15 |
|
| 16 |
-
const booking = new WeBookBooking(page);
|
| 17 |
-
const booked = await booking.bookEvent(eventUrl);
|
| 18 |
-
if (booked) {
|
| 19 |
-
|
| 20 |
-
} else {
|
| 21 |
-
|
| 22 |
-
}
|
| 23 |
}
|
|
|
|
| 13 |
process.exit(1);
|
| 14 |
}
|
| 15 |
|
| 16 |
+
// const booking = new WeBookBooking(page);
|
| 17 |
+
// const booked = await booking.bookEvent(eventUrl);
|
| 18 |
+
// if (booked) {
|
| 19 |
+
// console.info('Booking succeeded!');
|
| 20 |
+
// } else {
|
| 21 |
+
// console.error('Booking failed.');
|
| 22 |
+
// }
|
| 23 |
}
|