diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index edd7b553..7e7c9014 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -26,7 +26,7 @@ jobs: uses: docker/build-push-action@v1 with: dockerfile: front/Dockerfile - path: front/ + path: ./ username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} repository: thecodingmachine/workadventure-front @@ -49,7 +49,7 @@ jobs: uses: docker/build-push-action@v1 with: dockerfile: back/Dockerfile - path: back/ + path: ./ username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} repository: thecodingmachine/workadventure-back diff --git a/back/Dockerfile b/back/Dockerfile index 8b1b8f61..ca98a648 100644 --- a/back/Dockerfile +++ b/back/Dockerfile @@ -1,7 +1,9 @@ FROM thecodingmachine/nodejs:12 -COPY --chown=docker:docker . . +COPY --chown=docker:docker back . +COPY --chown=docker:docker messages ../messages RUN yarn install +RUN cd /usr/src/messages && yarn install ENV NODE_ENV=production diff --git a/back/src/Model/Websocket/ExSocketInterface.ts b/back/src/Model/Websocket/ExSocketInterface.ts index d7edf554..cd1f73ed 100644 --- a/back/src/Model/Websocket/ExSocketInterface.ts +++ b/back/src/Model/Websocket/ExSocketInterface.ts @@ -8,7 +8,7 @@ import {BatchMessage, SubMessage} from "../../../../messages/generated/messages_ export interface ExSocketInterface extends Socket, Identificable { token: string; roomId: string; - webRtcRoomId: string; + webRtcRoomId: string|undefined; userId: number; // A temporary (autoincremented) identifier for this user userUuid: string; // A unique identifier for this user name: string; diff --git a/front/Dockerfile b/front/Dockerfile index c5c605a8..ba2c422b 100644 --- a/front/Dockerfile +++ b/front/Dockerfile @@ -1,8 +1,10 @@ # we are rebuilding on each deploy to cope with the API_URL environment URL FROM thecodingmachine/nodejs:14-apache -COPY --chown=docker:docker . . +COPY --chown=docker:docker front . +COPY --chown=docker:docker messages /var/www/messages RUN yarn install +RUN cd /usr/src/messages && yarn install ENV NODE_ENV=production ENV STARTUP_COMMAND_1="yarn run build"