Skip to content

Commit

Permalink
Added docker and updated to support node 18
Browse files Browse the repository at this point in the history
  • Loading branch information
havfo committed Nov 7, 2022
1 parent 3949bcd commit 624920f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
**/.git
**/.gitignore
**/.eslintrc.json
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:18-bullseye-slim as builder

WORKDIR /app

COPY . .

RUN yarn install --frozen-lockfile
RUN yarn add eslint-config-react-app@v6 -D
RUN yarn run build

FROM nginx:stable-alpine

COPY --from=builder /app/build /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"ws": "^8.8.0"
},
"scripts": {
"start": "HTTPS=true PORT=4443 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"start": "HTTPS=true PORT=4443 react-scripts --openssl-legacy-provider start",
"build": "react-scripts --openssl-legacy-provider build",
"test": "react-scripts --openssl-legacy-provider test",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand Down
4 changes: 2 additions & 2 deletions src/services/signalingService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ export class SignalingService extends EventEmitter {
}

@skipIfClosed
public async notify(notification: SocketMessage): Promise<void> {
public notify(notification: SocketMessage): void {
logger.debug('notify() [method: %s]', notification.method);

for (const connection of this.connections.items) {
if (!connection.outgoing) continue;

try {
return await connection.notify(notification);
return connection.notify(notification);
} catch (error) {
logger.error('notify() [error: %o]', error);
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/BaseConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export declare interface BaseConnection {
*/
export abstract class BaseConnection
extends EventEmitter implements SignalingInterface {
public abstract notify(notification: SocketMessage): Promise<void>;
public abstract notify(notification: SocketMessage): void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public abstract request(request: SocketMessage): Promise<unknown>;
public abstract close(): void;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ProducerConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class ProducerConnection extends BaseConnection {
}

@skipIfClosed
public async notify(notification: SocketMessage): Promise<void> {
public notify(notification: SocketMessage): void {
logger.debug('notification() [notification: %o]', notification);

const rawNotification = RawSocket.createNotification(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/SignalingInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface SocketMessage {
*/
export interface SignalingInterface {
// Outbound messages
notify: (notification: SocketMessage) => Promise<void>;
notify: (notification: SocketMessage) => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
request: (request: SocketMessage) => Promise<unknown>;
close: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/SocketIOConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class SocketIOConnection extends BaseConnection {
}

@skipIfClosed
public async notify(notification: SocketMessage): Promise<void> {
public notify(notification: SocketMessage): void {
logger.debug('notification() [notification: %o]', notification);

this.socket.emit('notification', notification);
Expand Down

0 comments on commit 624920f

Please sign in to comment.