mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -04:00
Add transcoder's dockerfile
This commit is contained in:
parent
bc6fdec360
commit
d106988fd7
16
.github/workflows/coding-style.yml
vendored
16
.github/workflows/coding-style.yml
vendored
@ -41,6 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: yarn lint
|
run: yarn lint
|
||||||
|
|
||||||
scanner:
|
scanner:
|
||||||
name: "Lint scanner"
|
name: "Lint scanner"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -54,3 +55,18 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install black-with-tabs
|
pip install black-with-tabs
|
||||||
black . --check
|
black . --check
|
||||||
|
|
||||||
|
transcoder:
|
||||||
|
name: "Lint transcoder"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ./transcoder
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Run cargo fmt
|
||||||
|
run: |
|
||||||
|
cargo fmt --check
|
||||||
|
3
.github/workflows/docker.yml
vendored
3
.github/workflows/docker.yml
vendored
@ -24,6 +24,9 @@ jobs:
|
|||||||
- context: ./scanner
|
- context: ./scanner
|
||||||
label: scanner
|
label: scanner
|
||||||
image: zoriya/kyoo_scanner
|
image: zoriya/kyoo_scanner
|
||||||
|
- context: ./transcoder
|
||||||
|
label: transcoder
|
||||||
|
image: zoriya/kyoo_transcoder
|
||||||
name: Build ${{matrix.label}}
|
name: Build ${{matrix.label}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -29,6 +29,6 @@ COPY --from=transcoder /transcoder/libtranscoder.so /app
|
|||||||
|
|
||||||
WORKDIR /kyoo
|
WORKDIR /kyoo
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:5000/health || exit
|
HEALTHCHECK --interval=5s CMD curl --fail http://localhost:5000/health || exit
|
||||||
CMD /app/Kyoo.Host
|
CMD /app/Kyoo.Host
|
||||||
|
|
||||||
|
@ -25,6 +25,6 @@ COPY --from=transcoder /transcoder/libtranscoder.so /app/out/bin/Kyoo.Host/Debug
|
|||||||
WORKDIR /kyoo
|
WORKDIR /kyoo
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
ENV DOTNET_USE_POLLING_FILE_WATCHER 1
|
ENV DOTNET_USE_POLLING_FILE_WATCHER 1
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:5000/health || exit
|
HEALTHCHECK --interval=5s CMD curl --fail http://localhost:5000/health || exit
|
||||||
CMD dotnet watch run --no-restore --project /app/src/Kyoo.Host
|
CMD dotnet watch run --no-restore --project /app/src/Kyoo.Host
|
||||||
|
|
||||||
|
@ -50,6 +50,17 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${LIBRARY_ROOT}:/video
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
|
transcoder:
|
||||||
|
build:
|
||||||
|
context: ./transcoder
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
ports:
|
||||||
|
- "7666:7666"
|
||||||
|
restart: on-failure
|
||||||
|
volumes:
|
||||||
|
- ./transcoder:/app
|
||||||
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
image: nginx
|
image: nginx
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
@ -34,6 +34,12 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${LIBRARY_ROOT}:/video
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
|
transcoder:
|
||||||
|
image: zoriya/kyoo_transcoder:edge
|
||||||
|
restart: on-failure
|
||||||
|
volumes:
|
||||||
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
image: nginx
|
image: nginx
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
@ -34,6 +34,12 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${LIBRARY_ROOT}:/video
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
|
transcoder:
|
||||||
|
build: ./transcoder
|
||||||
|
restart: on-failure
|
||||||
|
volumes:
|
||||||
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
image: nginx
|
image: nginx
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM node:16-alpine AS builder
|
FROM node:16-alpine
|
||||||
RUN apk add git bash
|
RUN apk add git bash
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY .yarn ./.yarn
|
COPY .yarn ./.yarn
|
||||||
@ -14,4 +14,4 @@ RUN yarn --immutable
|
|||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
ENV NEXT_TELEMETRY_DISABLED 1
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
EXPOSE 19000
|
EXPOSE 19000
|
||||||
CMD ["yarn", "dev"]
|
CMD yarn dev
|
||||||
|
@ -15,6 +15,7 @@ in
|
|||||||
python3
|
python3
|
||||||
python3Packages.pip
|
python3Packages.pip
|
||||||
cargo
|
cargo
|
||||||
|
cargo-watch
|
||||||
rustfmt
|
rustfmt
|
||||||
rustc
|
rustc
|
||||||
];
|
];
|
||||||
|
20
transcoder/Dockerfile
Normal file
20
transcoder/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM rust as builder
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# FIX: see https://github.com/rust-lang/cargo/issues/2644
|
||||||
|
RUN mkdir src/ && touch src/lib.rs
|
||||||
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
RUN cargo build
|
||||||
|
RUN rm src/lib.rs
|
||||||
|
|
||||||
|
COPY src src
|
||||||
|
RUN cargo install --path .
|
||||||
|
|
||||||
|
FROM debian:bullseye-slim
|
||||||
|
#RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
|
||||||
|
COPY --from=builder /usr/local/cargo/bin/transcoder ./transcoder
|
||||||
|
|
||||||
|
ENV ROCKET_ADDRESS=0.0.0.0
|
||||||
|
ENV ROCKET_PORT=7666
|
||||||
|
EXPOSE 7666
|
||||||
|
CMD ./transcoder
|
14
transcoder/Dockerfile.dev
Normal file
14
transcoder/Dockerfile.dev
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM rust
|
||||||
|
RUN cargo install cargo-watch
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# FIX: see https://github.com/rust-lang/cargo/issues/2644
|
||||||
|
RUN mkdir src/ && touch src/lib.rs
|
||||||
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
RUN cargo build
|
||||||
|
RUN rm src/lib.rs
|
||||||
|
|
||||||
|
ENV ROCKET_ADDRESS=0.0.0.0
|
||||||
|
ENV ROCKET_PORT=7666
|
||||||
|
EXPOSE 7666
|
||||||
|
CMD cargo watch -x run
|
Loading…
x
Reference in New Issue
Block a user