From 5d4dc4f76db1c4b7e0feb0c65a54daee64e01cb8 Mon Sep 17 00:00:00 2001 From: Denis Bessa Date: Thu, 7 Aug 2025 11:42:18 -0300 Subject: [PATCH 1/2] Create docker-compose file --- docker-compose.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..66c434d12 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,44 @@ +services: + element-call: + build: + context: . + dockerfile_inline: | + FROM node as builder + WORKDIR /app + + RUN git clone https://github.com/element-hq/element-call.git . + RUN corepack enable + RUN yarn install + RUN yarn build + + FROM nginx:alpine + COPY --from=builder /app/dist /usr/share/nginx/html + RUN mkdir -p /usr/share/nginx/html/public + EXPOSE 80 + + CMD ["nginx", "-g", "daemon off;"] + ports: + - "3000:80" + command: ["sh", "-c", "echo \"$$CONFIG_JSON\" > /usr/share/nginx/html/config.json && exec nginx -g 'daemon off;'"] + environment: + CONFIG_JSON: | + { + "default_server_config": { + "m.homeserver": { + "base_url": "https://mydomain.com", + "server_name": "mydomain.com" + } + }, + "features": { + "feature_use_device_session_member_events": true + }, + "ssla": "https://static.element.io/legal/element-software-and-services-license-agreement-uk-1.pdf", + "matrix_rtc_session": { + "wait_for_key_rotation_ms": 3000, + "membership_event_expiry_ms": 180000000, + "delayed_leave_event_delay_ms": 18000, + "delayed_leave_event_restart_ms": 4000, + "network_error_retry_ms": 100 + } + } + restart: unless-stopped \ No newline at end of file From d95e5274ae29e07f73ce54acc8c8d4d1cabf0a6f Mon Sep 17 00:00:00 2001 From: Denis Bessa Date: Thu, 7 Aug 2025 12:23:27 -0300 Subject: [PATCH 2/2] Fixes docker-compose.yaml --- docker-compose.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 66c434d12..434bda4fe 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,7 @@ services: build: context: . dockerfile_inline: | - FROM node as builder + FROM node AS builder WORKDIR /app RUN git clone https://github.com/element-hq/element-call.git . @@ -12,14 +12,13 @@ services: RUN yarn build FROM nginx:alpine - COPY --from=builder /app/dist /usr/share/nginx/html - RUN mkdir -p /usr/share/nginx/html/public - EXPOSE 80 - - CMD ["nginx", "-g", "daemon off;"] + COPY --from=builder /app/dist /app + COPY --from=builder /app/config/nginx.conf /etc/nginx/conf.d/default.conf + EXPOSE 8080 ports: - - "3000:80" - command: ["sh", "-c", "echo \"$$CONFIG_JSON\" > /usr/share/nginx/html/config.json && exec nginx -g 'daemon off;'"] + - "8080:8080" + command: > + sh -c "echo \"$$CONFIG_JSON\" > /app/config.json && exec nginx -g 'daemon off;'" environment: CONFIG_JSON: | {