diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e6f7144 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,49 @@ +# MultiApp Dockerfile +# A GTKmm 4.0 application with WebKitGTK browser + +FROM debian:bookworm-slim + +# Set environment variables for non-interactive apt +ENV DEBIAN_FRONTEND=noninteractive + +# Install base dependencies, build tools, GTKmm 4.0, WebKitGTK 6.0, and X11 forwarding +RUN apt-get update && apt-get install -y \ + # Build essentials + build-essential \ + pkg-config \ + make \ + g++ \ + libgtkmm-4.0-dev \ + libwebkitgtk-6.0-dev \ + libasio-dev \ + libgtest-dev \ + libx11-dev \ + fonts-dejavu-core \ + fonts-font-awesome \ + fontconfig \ + locales \ + librsvg2-common \ + git \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 en_US.UTF-8 + +# Set locale +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +# Set working directory +WORKDIR /app + +# Copy source files +COPY . /app/ + +# Build the application +RUN make clean || true +RUN make + +# Set display environment variable for X11 forwarding +ENV DISPLAY=:0 + +# Default command - run the application +CMD ["./multiapp.exe"] diff --git a/README.md b/README.md index d5b9da6..737087b 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ In the future it should have apps that work using SQL, SDL and even web requests - [Roadmap](#️-roadmap) - [Requirements](#️-requirements) - [Build and Run](#-build-and-run) + - [Docker](#-docker) - [Screenshots](#-screenshots) ## 🧬 Project Structure @@ -50,12 +51,14 @@ In Arch based OS: - gtkmm-4.0 - webkitgtk-6.0 - asio +- gtest In Ubuntu/Debian based OS: - libgtkmm-4.0-dev - libwebkitgtk-6.0-dev - libasio-dev +- libgtest-dev ## 🔨 Build and run @@ -71,6 +74,19 @@ For cleaning building objects and executables, run: ``` make clean ``` It removes the build/, build_tests/, multiapp.exe and multiapp_tests.exe folders and files. +### 🐋 Docker + +You can also run with docker! +Just run to create a local image + +And then run the container using: + +- Linux: Run ``` xhost +local:docker ``` create the image using ```sudo docker build -t multiapp .``` and run with ```sudo docker run -it --rm -e DISPLAY=$DISPLAY --network host -v /tmp/.X11-unix:/tmp/.X11-unix multiapp``` + +- Windows: Use ```sudo docker build -t multiapp .``` and run with ``` docker run -it -e DISPLAY=$DISPLAY --network host -v /mnt/host/wslg/.X11-unix:/tmp/.X11-unix -v /mnt/host/wslg:/mnt/host/wslg multiapp ``` + +- Mac: ``` Use xquartz to allow the connection ```, then run ``` xhost +local:docker ``` finally create the image using ```sudo docker build -t multiapp .``` and run with ```sudo docker run -it --rm -e DISPLAY=$DISPLAY --network host -v /tmp/.X11-unix:/tmp/.X11-unix multiapp``` + ## 📷 Screenshots Here are some screenshots of the funtioning app on Linux.