Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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


36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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;"]
10 changes: 10 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri $uri/ /index.html;
}
}