Skip to content

Commit

Permalink
feat: live transcoding to HLS and origin for CDN shield pull
Browse files Browse the repository at this point in the history
  • Loading branch information
birme committed Jul 10, 2024
1 parent e282815 commit e6eafdf
Show file tree
Hide file tree
Showing 18 changed files with 1,206 additions and 65 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker Image to Docker Hub
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.HUB_DOCKER_USERNAME }}
password: ${{ secrets.HUB_DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: eyevinntechnology/live-encoding

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ ARG NODE_IMAGE=node:18-alpine
FROM ${NODE_IMAGE}
ENV NODE_ENV=production
EXPOSE 8000
RUN apk update
RUN apk add --no-cache ffmpeg
RUN mkdir /app
RUN chown node:node /app
RUN mkdir /data && chown node:node /data
USER node
WORKDIR /app
VOLUME [ "/data" ]
COPY --chown=node:node ["package.json", "package-lock.json*", "tsconfig*.json", "./"]
COPY --chown=node:node ["src", "./src"]
# Delete prepare script to avoid errors from husky
RUN npm pkg delete scripts.prepare \
&& npm ci --omit=dev
ENV ORIGIN_DIR=/data
CMD [ "npm", "run", "start" ]
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
testEnvironment: 'node'
};
2 changes: 1 addition & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"watch": ["src"],
"ext": "ts",
"exec": "node --inspect -r ts-node/register ./src/server.ts"
}
}
Loading

0 comments on commit e6eafdf

Please sign in to comment.