Skip to content

Commit

Permalink
🌐 [Ci]: media 서버 환경변수 및 record 서버 라이브러리 설치 스크립트 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
g00hyun committed Nov 20, 2024
1 parent 825ce89 commit 0cb86fb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/media-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
ANNOUNCED_IP: ${{ secrets.ANNOUNCED_IP }}
API_SERVER_URL: ${{ secrets.API_SERVER_URL }}
HTTP_TIMEOUT: ${{ secrets.HTTP_TIMEOUT }}
RECORD_SERVER_URL: ${{ secrets.RECORD_SERVER_URL }}
SERVER_PRIVATE_IP: ${{ secrets.SERVER_PRIVATE_IP }}

steps:
- name: Checkout code
Expand All @@ -46,6 +48,8 @@ jobs:
--build-arg ANNOUNCED_IP=$ANNOUNCED_IP \
--build-arg API_SERVER_URL=$API_SERVER_URL \
--build-arg HTTP_TIMEOUT=$HTTP_TIMEOUT \
--build-arg RECORD_SERVER_URL=$RECORD_SERVER_URL \
--build-arg SERVER_PRIVATE_IP=$SERVER_PRIVATE_IP \
.
- name: Push to Ncloud Container Registry
Expand Down Expand Up @@ -86,6 +90,8 @@ jobs:
-e DB_NAME=${{ secrets.DB_NAME }} \
-e API_SERVER_URL=${{ secrets.API_SERVER_URL }} \
-e HTTP_TIMEOUT=${{ secrets.HTTP_TIMEOUT }} \
-e RECORD_SERVER_URL=${{ secrets.RECORD_SERVER_URL }} \
-e SERVER_PRIVATE_IP=${{ secrets.SERVER_PRIVATE_IP }} \
${{ secrets.NCLOUD_REGISTRY_URL }}/media-camon:latest
sudo docker image prune -f
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/record-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- develop
- Fix/221
paths:
- 'apps/record/**'
jobs:
Expand Down
1 change: 1 addition & 0 deletions apps/media/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ REDIS_MEDIA=

# Settings for connecting to the api server
API_SERVER_URL=
RECORD_SERVER_URL=
HTTP_TIMEOUT=
4 changes: 4 additions & 0 deletions apps/media/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ ARG DB_NAME
ARG ANNOUNCED_IP
ARG API_SERVER_URL
ARG HTTP_TIMEOUT
ARG RECORD_SERVER_URL
ARG SERVER_PRIVATE_IP

ENV MEDIA_PORT=$MEDIA_PORT
ENV REDIS_HOST=$REDIS_HOST
Expand All @@ -60,6 +62,8 @@ ENV DB_NAME=$DB_NAME
ENV ANNOUNCED_IP=$ANNOUNCED_IP
ENV API_SERVER_URL=$API_SERVER_URL
ENV HTTP_TIMEOUT=$HTTP_TIMEOUT
ENV RECORD_SERVER_URL=$RECORD_SERVER_URL
ENV SERVER_PRIVATE_IP=$SERVER_PRIVATE_IP

# Media 서버 빌드 결과물 복사
COPY --from=base /app/apps/media/dist ./apps/media/dist
Expand Down
2 changes: 1 addition & 1 deletion apps/media/src/sfu/services/record.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class RecordService {
.then(({ data }) => data);

await transport.connect({
ip: '0.0.0.0',
ip: this.configService.get('SERVER_PRIVATE_IP'),
port,
});

Expand Down
2 changes: 2 additions & 0 deletions apps/record/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM node:22-alpine AS base

RUN apk add --no-cache ffmpeg

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
Expand Down

0 comments on commit 0cb86fb

Please sign in to comment.