Skip to content

Commit d0ab336

Browse files
committed
Update File HLS
1 parent 3fbb5ad commit d0ab336

File tree

5 files changed

+32
-17
lines changed

5 files changed

+32
-17
lines changed

FileService/.idea/.idea.FileService/.idea/workspace.xml

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FileService/FileService.Api/appsettings.Staging.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"FfmpegSettings": {
1414
"ExecutablePath": "Tools/ffmpeg"
1515
},
16+
"FfmpegConfig": {
17+
"WorkDir": "/tmp/ffmpeg",
18+
"SegmentDuration": 4,
19+
"PlaylistName": "master.m3u8"
20+
},
1621
"AppSettings": {
1722
"AllCharacters": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+/ ",
1823
"OTP": {

FileService/FileService.Api/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"Microsoft.AspNetCore": "Warning"
66
}
77
},
8-
"AllowedHosts": "*"
8+
"AllowedHosts": "*",
99
}

docker-compose.prod-services.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ services:
199199
- AppSettings__Jwt__Audience=Code Campus
200200
ports: [ "8082:8082" ]
201201
networks: [ backend ]
202-
202+
volumes:
203+
- file_tmp:/tmp/ffmpeg
204+
203205
gateway-service:
204206
image: ${DOCKERHUB_USER}/codecampus-gateway-service:${IMAGE_TAG:-latest}
205207
environment:
@@ -229,4 +231,5 @@ networks:
229231

230232
volumes:
231233
runner_data:
232-
ai_uploads:
234+
ai_uploads:
235+
file_tmp:

docker/file-service.Dockerfile

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,36 @@
22
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
33
WORKDIR /src
44

5-
COPY FileService/FileService.Core/FileService.Core.csproj FileService.Core/
5+
# Copy project files to leverage restore cache
6+
COPY FileService/FileService.Core/FileService.Core.csproj FileService.Core/
67
COPY FileService/FileService.DataAccess/FileService.DataAccess.csproj FileService.DataAccess/
7-
COPY FileService/FileService.Service/FileService.Service.csproj FileService.Service/
8-
COPY FileService/FileService.Api/FileService.Api.csproj FileService.Api/
8+
COPY FileService/FileService.Service/FileService.Service.csproj FileService.Service/
9+
COPY FileService/FileService.Api/FileService.Api.csproj FileService.Api/
910

1011
RUN dotnet restore "FileService.Api/FileService.Api.csproj"
1112

12-
# Copy toàn bộ source
13+
# Copy full source and publish
1314
COPY FileService/ ./FileService/
14-
15-
# Publish
1615
WORKDIR /src/FileService/FileService.Api
1716
RUN dotnet publish -c Release -o /app/publish
1817

1918
# ====== Runtime stage ======
2019
FROM mcr.microsoft.com/dotnet/aspnet:8.0
21-
WORKDIR /app
22-
COPY --from=build /app/publish .
2320

24-
# Cài đặt FFmpeg (bao gồm ffprobe)
21+
# Install FFmpeg + ffprobe (non-interactive, minimal)
2522
RUN apt-get update \
26-
&& apt-get install -y ffmpeg \
27-
&& rm -rf /var/lib/apt/lists/*
23+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ffmpeg ca-certificates \
24+
&& rm -rf /var/lib/apt/lists/*
2825

26+
# A writable temp dir for FFmpeg work files
27+
RUN mkdir -p /tmp/ffmpeg-tmp && chmod -R 777 /tmp/ffmpeg-tmp
28+
29+
WORKDIR /app
30+
COPY --from=build /app/publish .
2931

3032
ENV ASPNETCORE_URLS=http://+:8082 \
31-
ASPNETCORE_ENVIRONMENT=docker
33+
ASPNETCORE_ENVIRONMENT=docker \
34+
TMPDIR=/tmp
3235

3336
EXPOSE 8082
3437
ENTRYPOINT ["dotnet", "FileService.Api.dll"]
35-

0 commit comments

Comments
 (0)