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

Simplify setup by using Docker #405

Open
1 of 6 tasks
SjoenH opened this issue Jun 4, 2024 · 1 comment
Open
1 of 6 tasks

Simplify setup by using Docker #405

SjoenH opened this issue Jun 4, 2024 · 1 comment
Labels
backend Server related chess logic Chess engine related database Database related general General problems or issues

Comments

@SjoenH
Copy link
Contributor

SjoenH commented Jun 4, 2024

Todo:

  • Create a Dockerfile for the front-end
  • Create a Dockerfile for the back-end
  • Create a docker-compose.yml file to manage the containers

The Plan

We aim for a simplified setup, ideally to be executed on a Raspberry Pi 5.

Here's a diagram illustrating the necessary application containers:

graph LR
    title[Chess Robot Application Containers]
    database[PostgresSQL]
    chess-logic[Stockfish UCI]
    backend[Python backend - flask api]
    frontend[React frontend]
    database --> backend
    chess-logic --> backend
    backend --> frontend
Loading
Component Status
Front-end ✅ Completed. Refer to the frontend folder
Back-end Pending. Requires integration with the chess-board driver
Database Consider using the official image
Chess-logic Utilize tchorwat/stockfish

Front-end

The front-end is completed. Refer to the frontend folder.

Back-end

The back-end is pending.
It requires integration with the chess-board driver.
Might also need to adjust the python code to use the Stockfish UCI and the database.

  • Integrate with the chess-board driver
  • Adjust the python code to use the Stockfish UCI docker image
  • Adjust the python code to use the database docker image

Database:

Consider using the official image: https://hub.docker.com/_/postgres

docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres

Chess-logic

A Docker image for this component already exists. Refer to: https://github.com/tchorwat/stockfish

To run the Docker image, use the following command:

docker run -d -p 23249:23249 tchorwat/stockfish

Docker Compose

We can use Docker Compose to manage the containers.

Here's an example of a docker-compose.yml file:

version: '3.8'

services:
  frontend:
    image: frontend:latest
    ports:
      - "3000:3000"

  backend:
    image: backend:latest
    ports:
      - "5000:5000"

  database:
    image: postgres:latest
    environment:
      POSTGRES_PASSWORD: mysecretpassword

  chess-logic:
    image: tchorwat/stockfish:latest
    ports:
      - "23249:23249"
@SjoenH SjoenH added backend Server related chess logic Chess engine related general General problems or issues database Database related labels Jun 4, 2024
@SjoenH
Copy link
Contributor Author

SjoenH commented Jun 21, 2024

@brotherBear please help with python dependencies 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Server related chess logic Chess engine related database Database related general General problems or issues
Projects
None yet
Development

No branches or pull requests

1 participant