Add daemon submodule and Docker support
Update .gitignore and README.md
Add .gitreview file
Change-Id: If4800ae668ecc38cf64bfca540c6f0731541fb42
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..88eda90
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,15 @@
+.idea/
+.vscode/
+
+daemon/build-local/
+daemon/contrib/native*
+daemon/contrib/i386*
+daemon/contrib/x86_64-*
+daemon/contrib/arm*
+daemon/contrib/aarch64*
+daemon/contrib/i686*
+
+node_modules/
+dist/
+
+client/dist/
diff --git a/.gitignore b/.gitignore
index 4e65dab..d1a74c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,7 @@
.env
dring.node
jamid.node
+
+.idea/
+.vscode/
+*.iml
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..6a5bb30
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "jami-daemon"]
+ path = daemon
+ url = https://review.jami.net/jami-daemon
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..5c29e0e
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=review.jami.net
+port=29420
+project=jami-web
+defaultremote=origin
+defaultbranch=master
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..2ef623b
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,67 @@
+FROM ubuntu:22.04
+
+WORKDIR /app
+COPY . .
+
+ARG DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y \
+ autoconf \
+ automake \
+ autopoint \
+ bison \
+ build-essential \
+ cmake \
+ curl \
+ git \
+ libasound2-dev \
+ libdbus-1-dev \
+ libexpat1-dev \
+ libpulse-dev \
+ libtool \
+ libudev-dev \
+ libva-dev \
+ libvdpau-dev \
+ nasm \
+ pkg-config \
+ yasm
+
+# Install Node
+RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
+ apt-get install -y nodejs && \
+ npm install -g node-gyp
+
+# Install latest Swig (4.1)
+WORKDIR /swig
+RUN git clone https://github.com/swig/swig.git && \
+ cd swig && \
+ ./autogen.sh && \
+ ./configure && \
+ make -j$(nproc) && \
+ make install
+
+WORKDIR /app/daemon
+
+# Build daemon dependencies
+RUN mkdir -p contrib/native && \
+ cd contrib/native && \
+ ../bootstrap && \
+ make -j$(nproc)
+
+# Build the daemon
+RUN ./autogen.sh && \
+ ./configure --with-nodejs && \
+ make -j$(nproc)
+
+WORKDIR /app
+
+RUN apt-get update && apt-get install -y \
+ lldb \
+ liblldb-dev
+
+ENV LD_LIBRARY_PATH=/app/daemon/src/.libs
+ENV SECRET_KEY_BASE=test123
+RUN npm install && \
+ ln -s /app/daemon/bin/nodejs/build/Release/jamid.node jamid.node && \
+ npm run build
+
+CMD ["npm", "start"]
diff --git a/README.md b/README.md
index f4f9b20..581103a 100644
--- a/README.md
+++ b/README.md
@@ -21,3 +21,21 @@
LD_LIBRARY_PATH=$PATH_TO_JAMI_PROJECT/ring-project/install/daemon/lib node
To build the dring.node Javascript interface to talk to the daemon api go to the daemon repo and use ./configure --with-nodejs then execute make -j4 to build the daemon
+
+# Docker
+
+You may run the web server in a Docker container. This will automatically build the daemon and do the necessary linking.
+
+```bash
+docker build -t jami-web .
+docker run -it -p 3000:3000 jami-web
+```
+
+## Using [docker-compose](docker run -p 3000:3000 -it jami-project
+)
+This will use a [Docker Volume](https://docs.docker.com/storage/volumes/) to enable auto-refresh when you change a file.
+
+```bash
+docker-compose build
+docker-compose up
+```
diff --git a/daemon b/daemon
new file mode 160000
index 0000000..206112b
--- /dev/null
+++ b/daemon
@@ -0,0 +1 @@
+Subproject commit 206112b5794d754c426dac91cbda9094daf6cd42
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..97e4ecb
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,11 @@
+version: "3"
+
+services:
+ jami-web:
+ build: .
+ image: jami-web
+ volumes:
+ - ./client:/app/client
+ ports:
+ - "3000:3000"
+ stdin_open: true
diff --git a/package-lock.json b/package-lock.json
index 1044460..e0f166c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -37,6 +37,7 @@
}
},
"client": {
+ "name": "jami-web-client",
"version": "0.1.0",
"dev": true,
"dependencies": {