From f0ddfa77ca8594b540b30dbbbb22a15edc83a26e Mon Sep 17 00:00:00 2001 From: "Thadah D. Denyse" Date: Mon, 16 Feb 2026 13:25:23 +0100 Subject: [PATCH] Add docker support --- .dockerignore | 28 ++++++++++++++++++++++++++++ Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ docker/nginx.conf | 10 ++++++++++ 3 files changed, 74 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker/nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..6d87932cd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,28 @@ +# Git +.git/ + +# Build outputs +commet/build/ +**/build/ + +# IDE +.vscode/ +.idea/ +*.iml + +# Remove platforms not needed for web +commet/android/ +commet/ios/ +commet/macos/ +commet/linux/ +commet/windows/ + +# Other files +commet/assets/js/package/ +commet/integration_test/ +commet/test_driver/ +commet/integration_test/ +commet/coverage/ +*.tar.gz + + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..dd915ea6d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM ghcr.io/cirruslabs/flutter:3.35.4 AS build + +RUN sudo apt-get update && sudo apt-get install -y \ + ninja-build \ + libgtk-3-dev \ + libmpv-dev \ + mpv \ + ffmpeg \ + webkit2gtk-4.1 + +# Rust nightly for vodozemac +RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly +ENV PATH="/root/.cargo/bin:${PATH}" +RUN rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu + +WORKDIR /app +COPY . . +WORKDIR /app/commet + +# Codegen and prepare-web +RUN dart run scripts/codegen.dart +RUN ./scripts/prepare-web.sh + +ARG GIT_HASH=unknown +ARG VERSION_TAG=v0.0.0 + +# Build with flutter web +RUN dart run scripts/build_release.dart --platform web --git_hash $GIT_HASH --version_tag $VERSION_TAG + +FROM nginx:alpine +RUN rm -rf /usr/share/nginx/html +COPY docker/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/commet/build/web /usr/share/nginx/html +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 000000000..3c25a987b --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,10 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } +}