diff --git a/client/Dockerfile b/client/Dockerfile index 4515507..3e8aa9f 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,11 +1,15 @@ FROM node:22-alpine AS build WORKDIR /app -COPY package.json package-lock.json ./ +COPY client/package.json client/package-lock.json ./ RUN npm ci -COPY . . +COPY client/ . RUN npm run build FROM nginx:alpine +RUN apk add --no-cache php83 php83-fpm php83-curl php83-ctype +RUN echo 'clear_env = no' >> /etc/php83/php-fpm.d/www.conf COPY --from=build /app/dist /usr/share/nginx/html -COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY deploy/php/media_proxy.php /usr/share/nginx/html/media_proxy.php +COPY client/nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 +CMD ["sh", "-c", "php-fpm83 && exec nginx -g 'daemon off;'"] diff --git a/client/nginx.conf b/client/nginx.conf index 247e92a..222422e 100644 --- a/client/nginx.conf +++ b/client/nginx.conf @@ -5,6 +5,19 @@ server { resolver 127.0.0.11 valid=10s; + location /auth/session/ { + set $server_upstream http://server:4474; + proxy_pass $server_upstream; + proxy_http_version 1.1; + proxy_set_header Host $host; + } + + location ~ \.php$ { + fastcgi_pass 127.0.0.1:9000; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + location /ws { set $server_upstream http://server:4474; proxy_pass $server_upstream; diff --git a/docker-compose.yml b/docker-compose.yml index 188bdf4..d9b7bbb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,8 +26,13 @@ services: - livekit client: - build: ./client + build: + context: . + dockerfile: client/Dockerfile restart: unless-stopped + environment: + - CHGRID_HOST_ORIGIN=${CHGRID_HOST_ORIGIN:-http://localhost} + - CHGRID_MEDIA_PROXY_SESSION_CHECK_URL=http://server:4474/auth/session/check ports: - "127.0.0.1:4474:80" depends_on: