diff --git a/.dockerignore b/.dockerignore index 3256a9c..0c4d23f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,18 @@ -* -!package*.json -!dist \ No newline at end of file +.dockerignore +.editorconfig +.env* +.git +.github +.gitignore +.prettier* +.vscode +ca/*.crt +ca/*.key +ca/*.pem +ca/*.req +docker-compose* +Dockerfile* +LICENSE +dist* +node_modules* +README.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0fd108b..bd38354 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ FROM node:16-alpine -WORKDIR /app +RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app +WORKDIR /home/node/app COPY package*.json ./ -RUN npm ci --prod - -COPY ./dist ./dist USER node +RUN npm ci + +COPY --chown=node:node . ./ +RUN npm run build EXPOSE 8080 diff --git a/docker-compose.yml b/docker-compose.yml index 36bf161..787fa86 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: BACKEND_V2_POST_URL: http://localhost:8080/api/v2/scenes/ LIBRARY_URL: https://libraries.excalidraw.com LIBRARY_BACKEND: https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries - SOCKET_SERVER_URL: http://localhost:5000/ + SOCKET_SERVER_URL: http://localhost:5001/ STORAGE_BACKEND: "http" HTTP_STORAGE_BACKEND_URL: "http://localhost:8080/api/v2" @@ -26,7 +26,7 @@ services: excalidraw-room: image: excalidraw/excalidraw-room ports: - - "5000:80" + - "5001:80" redis: image: redis diff --git a/src/rooms/rooms.controller.ts b/src/rooms/rooms.controller.ts index b2fa499..bbb0c26 100644 --- a/src/rooms/rooms.controller.ts +++ b/src/rooms/rooms.controller.ts @@ -38,6 +38,8 @@ export class RoomsController { @Put(':id') async create(@Param() params, @Body() payload: Buffer) { + console.log(payload) + console.log(params) const id = params.id; await this.storageService.set(id, payload, this.namespace); this.logger.debug(`Created room ${id}`);