-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2be8e4
commit 5999f37
Showing
8 changed files
with
144 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM debian:bookworm AS build | ||
|
||
RUN sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list.d/debian.sources && \ | ||
apt update && \ | ||
apt upgrade -y && \ | ||
apt install -y curl build-essential pkg-config yasm libfdk-aac-dev libvpx-dev libx264-dev libopencv-dev clang && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /src | ||
|
||
# Build ffmpeg | ||
RUN curl https://ffmpeg.org/releases/ffmpeg-7.0.tar.xz | tar xJ && \ | ||
mv ffmpeg-7.0 ffmpeg | ||
RUN cd ffmpeg && mkdir build && ./configure --prefix=/src/ffmpeg/build --pkg-config-flags="--static" --enable-nonfree --enable-gpl --enable-libx264 --enable-libvpx --enable-libfdk-aac --disable-stripping --disable-decoder=exr,phm && make -j$(nproc) && make install | ||
|
||
# Install rust toolchain | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Build vidformer | ||
COPY ./Cargo.toml ./ | ||
COPY ./vidformer ./vidformer | ||
COPY ./vidformer-cli ./vidformer-cli | ||
COPY ./vidformer-igni ./vidformer-igni | ||
ENV FFMPEG_PKG_CONFIG_PATH="/src/ffmpeg/build/lib/pkgconfig" FFMPEG_INCLUDE_DIR="/src/ffmpeg/build/include" | ||
RUN cargo build --release -p vidformer-igni | ||
|
||
FROM debian:bookworm | ||
|
||
RUN sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list.d/debian.sources && \ | ||
apt update && \ | ||
apt upgrade -y && \ | ||
apt install -y libopencv-dev libfdk-aac-dev wait-for-it && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=build /src/target/release/vidformer-igni /usr/local/bin/vidformer-igni | ||
|
||
EXPOSE 8000 | ||
ENTRYPOINT [ "/usr/local/bin/vidformer-igni" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name localhost; | ||
|
||
access_log /var/log/nginx/host.access.log main; | ||
|
||
location / { | ||
proxy_pass http://igni:8080; | ||
proxy_set_header Host $host; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
services: | ||
postgres: | ||
image: postgres:latest | ||
container_name: igni_db | ||
environment: | ||
POSTGRES_USER: igni | ||
POSTGRES_PASSWORD: igni | ||
POSTGRES_DB: igni | ||
ports: | ||
- "127.0.0.1:5432:5432" | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
- ./init:/docker-entrypoint-initdb.d | ||
web: | ||
image: nginx | ||
container_name: igni_web | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf | ||
- ./conf.d:/etc/nginx/conf.d | ||
- nginx_logs:/var/log/nginx | ||
igni: | ||
image: igni | ||
container_name: igni_app | ||
entrypoint: ["wait-for-it", "postgres:5432", "--", "/usr/local/bin/vidformer-igni", "server", "--config", "/etc/igni.toml"] | ||
environment: | ||
IGNI_DB: postgres://igni:igni@postgres:5432/igni | ||
ports: | ||
- "127.0.0.1:8080:8080" | ||
volumes: | ||
- ./igni.toml:/etc/igni.toml | ||
depends_on: | ||
- postgres | ||
volumes: | ||
postgres_data: | ||
nginx_logs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters