Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Add documentation for running Docker file. #78

Open
1 of 8 tasks
Pranav0-0Aggarwal opened this issue Nov 25, 2024 · 10 comments · May be fixed by #81
Open
1 of 8 tasks

DOC: Add documentation for running Docker file. #78

Pranav0-0Aggarwal opened this issue Nov 25, 2024 · 10 comments · May be fixed by #81
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@Pranav0-0Aggarwal
Copy link
Member

What's wrong with the existing documentation

Steps for Setting Up and Running the Dockerized Version of PictoPy

  • Prerequisites
  • List the required tools and system requirements.
  • Clone the PictoPy repository.
  • Build the Docker image using the provided Dockerfile.
  • Run the Docker container.
  • Document probable issues and solutions.

Add ScreenShots

No response

Record

  • I agree to follow this project's Code of Conduct
  • I want to work on this issue
@Pranav0-0Aggarwal Pranav0-0Aggarwal added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 25, 2024
@Rajgupta36
Copy link
Contributor

@Pranav0-0Aggarwal , can i work on it ?

@Pranav0-0Aggarwal
Copy link
Member Author

sure, but will you be able to work on so many issues all together?

@Jibesh10101011
Copy link
Contributor

@Pranav0-0Aggarwal , I also want to work on this , can I ?

@Pranav0-0Aggarwal
Copy link
Member Author

Assigning this to you @Jibesh10101011
I think @Rajgupta36 already has a lot, if he still wants to work, then you both coordinate.

@Rajgupta36
Copy link
Contributor

Rajgupta36 commented Nov 25, 2024

Assigning this to you @Jibesh10101011 I think @Rajgupta36 already has a lot, if he still wants to work, then you both coordinate.

@Pranav0-0Aggarwal , sir I have resolved all the issues I was working on. @Jibesh10101011 i will always be ready to coordinate with you.

@Pranav0-0Aggarwal
Copy link
Member Author

sure @Rajgupta36 , assigned this to you too
Please coordinate and work on this issue.

@Jibesh10101011
Copy link
Contributor

@Pranav0-0Aggarwal , @Rajgupta36

Steps for Setting Up and Running the Dockerized Version of PictoPy: A Short Demo

Prerequisites :

Docker Installation

List the required tools and system requirements.

Tools
Docker: To containerize the application.

System Requirements

  1. Operating System : Any OS that supports Docker (Windows, macOS, Linux).
  2. Hardware : At least 4 GB of RAM recommended for smooth performance.
  3. Disk Space : Adequate disk space to store Docker images and containers.

Clone the PictoPy Repository

git clone https://github.com/AOSSIE-Org/PictoPy.git

Build the Docker Image Using the Provided Dockerfile

Backend : docker build -t <backend-image_name> .
Frontend : docker build --build-arg TAURI_SIGNING_PRIVATE_KEY=dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5NlF2SjE3cWNXOVlQQ0JBTlNITEpOUVoyQ3ZuNTdOSkwyNE1NN2RmVWQ1a0FBQkFBQUFBQUFBQUFBQUlBQUFBQU9XOGpTSFNRd0Q4SjNSbm5Oc1E0OThIUGx6SS9lWXI3ZjJxN3BESEh1QTRiQXlkR2E5aG1oK1g0Tk5kcmFzc0IvZFZScEpubnptRkxlbDlUR2R1d1Y5OGRSYUVmUGoxNTFBcHpQZ1dSS2lHWklZVHNkV1Byd1VQSnZCdTZFWlVGOUFNVENBRlgweUU9Cg== --build-arg TAURI_SIGNING_PRIVATE_KEY_PASSWORD=pass -t <frontend-image_name> .

Run the Docker container.

Backend: docker run --rm -p 8000:8000 -it <backend-image_name>
Frontend : docker run --rm -p 1420:1420 -it <frontend-image_name>

Document Probable Issues and Solutions

  1. Docker Not Installed
    Solution: Follow the official Docker installation guide for your operating system.

  2. Check Line Endings in run.sh:
    Ensure that run.sh uses Unix line endings (LF)
    Solution : You can convert line endings using tools like : dos2unix run.sh

  3. Port Conflicts
    Solution: Ensure the ports (1420 for frontend and 8000 for backend) are not being used by other applications. You can change the ports if necessary.

  4. Build Errors
    Solution: Check the build logs for detailed error messages. Ensure all dependencies are installed and paths are correct.

  5. Issue: Missing Environment Variables
    Solution: Ensure TAURI_SIGNING_PRIVATE_KEY and TAURI_SIGNING_PRIVATE_KEY_PASSWORD are set correctly. Consider using Docker secrets for sensitive data.

  6. Issue: Directory Not Found
    Solution : Verify that all paths specified in the Dockerfile exist and are correct. Use debugging steps to check directory contents.

@Pranav0-0Aggarwal , @Rajgupta36 : can you please suggest if there are any additional steps, tools, or prerequisites that I might have missed.

@Rajgupta36
Copy link
Contributor

@Jibesh10101011, the frontend Docker container is not running directly, and there are some dependencies missing in the Dockerfile. I am working on fixing it before creating the documentation

@Jibesh10101011
Copy link
Contributor

@Rajgupta36

image

image

The frontend opens in web view but does not work in desktop view due to Docker's limitations.

In the previous code if you update vite.config.ts

image

to :

server: {
host: true,
port: 1420,
strictPort: true, // Ensures Vite fails if the port is unavailable
watch: {
// 3. tell vite to ignore watching src-tauri
ignored: ['/src-tauri/'],
},

The host: true option ensures the server is accessible externally (binds to 0.0.0.0).
Now you can access the frontend via a browser. However, as a desktop application, this approach does not work.

The issue arises because the Tauri application attempts to render a graphical user interface (GUI) using GTK within a Docker container. Containers generally lack access to a display environment (such as X11 or Wayland), causing GTK to fail with the warning:
"Cannot open display."

@Rajgupta36
Copy link
Contributor

@Jibesh10101011 , you using git it also have x that's provide display access. for linux we need x and for windows can we use multiple things

@Rajgupta36 Rajgupta36 linked a pull request Nov 26, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants