From 2d32de22beea2982f05314850dc9726013b26a0d Mon Sep 17 00:00:00 2001 From: Axle-Bucamp Date: Sun, 27 Apr 2025 16:40:22 -0500 Subject: [PATCH] mkv support --- Dockerfile | 32 +++++++++++++++++++ docker-compose.yml | 19 +++++++++++ docker/docker-compose.yml | 2 +- nginx.conf | 11 +++++++ package-lock.json | 2 +- playwright.config.ts | 2 +- .../vjs-player/vjs-player.component.html | 1 + 7 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..2f4dab3e4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# Stage 1 - build environment +FROM node:22-alpine AS build + +RUN apk add --no-cache python3 make g++ git + +# Create app directory +WORKDIR /usr/src/app + +# Swtich to node user +#RUN chown node:node ./ +#USER node + +COPY .npmrc ./ +COPY package*.json ./ + +# Install app dependencies +RUN npm ci + +# Copy all required files +COPY . . + +# Build the application +RUN npm run build:web + +# Stage 2 - the production environment +FROM nginx:stable-alpine + +# Copy artifacts and nignx.conf +COPY --from=build /usr/src/app/dist/browser /usr/share/nginx/html +COPY --from=build /usr/src/app/docker/nginx.conf /etc/nginx/conf.d/default.conf + +CMD sed -i "s#http://localhost:3333#$BACKEND_URL#g" /usr/share/nginx/html/main.js && nginx -g 'daemon off;' \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..1601d6ef7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +--- +services: + backend: + image: 4gray/iptvnator-backend:latest + ports: + - "7333:3000" + environment: + - CLIENT_URL=http://localhost:4333 + # this one should match with the address and port in frontend CLIENT_URL env + + frontend: + build : + context: . + ports: + - "4333:80" + environment: + - BACKEND_URL=http://localhost:7333 + # this one should match with the address of the backend service + diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index d36ab1c08..a2d5c3013 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -9,7 +9,7 @@ services: # this one should match with the address and port in frontend CLIENT_URL env frontend: - image: 4gray/iptvnator:latest + image: . ports: - "4333:80" environment: diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 000000000..3eacd9674 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,11 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html =404; + } + + include /etc/nginx/extra-conf.d/*.conf; +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 73cad6ce3..8914e741d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "iptvnator", - "version": "1.0.0-beta.5", + "version": "1.0.0-beta.6", "dependencies": { "@angular-builders/jest": "17.0.0", "@angular/animations": "19.2.0", diff --git a/playwright.config.ts b/playwright.config.ts index 9a0c6852d..bb47936fb 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -13,7 +13,7 @@ export default defineConfig({ }, use: { ...devices['Desktop Chrome'], - baseURL: 'http://localhost:4200', + baseURL: 'http://0.0.0.0:4200', headless: false, screenshot: 'only-on-failure', testIdAttribute: 'data-test-id', diff --git a/src/app/player/components/vjs-player/vjs-player.component.html b/src/app/player/components/vjs-player/vjs-player.component.html index abe0d6204..4241136a1 100644 --- a/src/app/player/components/vjs-player/vjs-player.component.html +++ b/src/app/player/components/vjs-player/vjs-player.component.html @@ -6,4 +6,5 @@ playsinline preload="none" data-setup='{"liveui": true, "muted": false}' + type='video/x-matroska; codecs="theora, vorbis"' >