jitsi / docker-jitsi-meet

Jitsi Meet on Docker
https://hub.docker.com/u/jitsi/
Apache License 2.0
3k stars 1.34k forks source link

How to build a custom docker image of jitsi-meet (web) and integrate it with the dockerized jitsi-meet components #1824

Open baby-leo opened 2 weeks ago

baby-leo commented 2 weeks ago

i have cloned “GitHub - jitsi/jitsi-meet: Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.”, and customized it for my liking , now what i am trying to do is to build a docker image of my custom jitsi meet and compose it with the official dockerjitsi meet, replacing the jitsi-web-image. here is my docker file on my custum jitsi-meet

# Use the official Node.js image as the base image
FROM node:16

# Set the working directory inside the container
# COPY /var/www/lib-jitsi-meet  /var/www/
WORKDIR /var/www/customjitsi-meet-folder

# Copy package.json and package-lock.json to the working directory
COPY customjitsi-meet/package.json ./

# Install dependencies with legacy-peer-deps
RUN npm install --legacy-peer-deps

# Copy the rest of your application code to the working directory
COPY . .

# Remove existing lib-jitsi-meet and link the cloned one
RUN rm -rf /var/www/customjitsi-meet-folder/customjitsi-meet/node_modules/lib-jitsi-meet

# Link lib-jitsi-meet
WORKDIR /var/www/customjitsi-meet-folder/lib-jitsi-meet
RUN npm install && npm link

WORKDIR /var/www/customjitsi-meet-folder/customjitsi-meet
RUN npm link lib-jitsi-meet

# Build lib-jitsi-meet
WORKDIR /var/www/customjitsi-meet-folder/lib-jitsi-meet
RUN npm update && npm run build

# Build customjitsi-meet
WORKDIR /var/www/customjitsi-meet-folder/customjitsi-meet
RUN make

# Set environment variables if required
ENV NODE_OPTIONS="--max-old-space-size=8192"

# Build customjitsi-meet
WORKDIR /var/www/customjitsi-meet-folder

# Expose ports 80 and 443
EXPOSE 80 443

# Define the command to run your application

CMD ["npm", "start"]
`
and i am trying to replace the image like as follows
`
web:
        # image: jitsi/web:${JITSI_IMAGE_VERSION:-stable-9457-2}
        image: customjitsi-meet-folder
        # image: jitsimeettest
        restart: ${RESTART_POLICY:-unless-stopped}
        # restart: always
        ports:
            - '8181:80'
            - '8443:443'
        volumes:
            - ${CONFIG}/web:/config
            - ${CONFIG}/web/crontabs:/var/spool/cron/crontabs:Z
            - ${CONFIG}/transcripts:/usr/share/jitsi-meet/transcripts

            # - /var/www/docker-jitsi-meet-stable-9457-2/web/:/usr/share/jitsi-meet
        environment:

and when i run compose up -d my custom jitsi meet is not appearing in my browser

so how should i compose my custom jitsi meet ??

saghul commented 2 weeks ago

You could use a multi-stage build that builds the frontend and then takes the existing image and replaces the files. You'd run the resulting image.

baby-leo commented 2 weeks ago

You could use a multi-stage build that builds the frontend and then takes the existing image and replaces the files. You'd run the resulting image.

ok so how can i do that?

saghul commented 2 weeks ago

You can start here: https://docs.docker.com/build/building/multi-stage/

Basically the steps would be: