MyLists icon indicating copy to clipboard operation
MyLists copied to clipboard

Request: Docker deploy

Open dillfrescott opened this issue 1 year ago • 13 comments

A ready to go docker container would be nice. Preferably with an .env file to enter the keys and variables. I would appreciate this if it was added :)

dillfrescott avatar Dec 24 '24 21:12 dillfrescott

Did you mean deploying frontend and backend Docker images to Docker Hub?

vwency avatar Dec 25 '24 16:12 vwency

If you need help setting up or improving your GitHub workflows for deployment, i can do this

vwency avatar Dec 25 '24 16:12 vwency

Oh sorry I meant like premade containers for the project to make it easier to deploy.

dillfrescott avatar Dec 25 '24 17:12 dillfrescott

  • docker-compose.yml (root dir)

services:
  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    volumes:
      - ./build:/app/build
    ports:
      - "3000:3000"
    networks:
      my_network:
        ipv4_address: 192.168.1.2
      
networks:
  my_network:
    driver: bridge
    ipam:
      config:
        - subnet: "192.168.1.0/24" 

/front

  • Dockerfile
FROM node:alpine AS build
WORKDIR /app


COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build


WORKDIR /app/build

vwency avatar Dec 25 '24 19:12 vwency

When i try build front-end via npm i got blank page it's correctly?

vwency avatar Dec 27 '24 11:12 vwency

Do you have any errors in the browser console ?

Crossoufire avatar Dec 27 '24 12:12 Crossoufire

Uncaught SyntaxError: The requested module 
'/node_modules/.vite/deps/react-icons_lu.js?v=043c0d89' 
does not provide an export named 'LuLoader2' (at SearchBar.jsx:8:9)

Do you have any errors in the browser console ?

vwency avatar Dec 27 '24 13:12 vwency

Ok these are errors related to react-icons. They changed the names of some Lucide icons. I have changed that in the dev versions.

  • You can either try to downgrade the react icons package (don't know if this would work)
  • Manually change the names of the faulty icons
  • Wait for the dev versions to be merged with the main (I'm currently working to add the manga as a list, so it could take some time)

Crossoufire avatar Dec 28 '24 10:12 Crossoufire

  • You can either try to downgrade the react icons package (don't know if this would work)

5.3.0 works. (I have tested it.)

mabezi avatar Jan 02 '25 07:01 mabezi

I managed to get the software running in a dockerized environment. But honestly, it was a lot of effort.

I could help out if needed, but first there's something else for me to sort out: Is the version on GitHub really production ready?

I had to make adjustments that definitely had nothing to do with Docker.

And the README is missing some information, for example that Poetry >=1.8 is required or that you need redis based on default values in config.py.

mabezi avatar Jan 02 '25 07:01 mabezi

Thanks for the feedback and for running it in Dockerized environment.

The main branch on GitHub is not really production-ready. This is an active, solo project, and I do changes quite frequently. I would like it to be more stable and polished, but this is still work in progress.

I have updated the README to include the requirement for Poetry. The Redis is also mentioned in the config.py under the Flask-Caching section:

# Flask-Caching
CACHE_TYPE = os.environ.get("CACHE_TYPE") or "RedisCache"
CACHE_REDIS_HOST = os.environ.get("CACHE_REDIS_HOST") or "localhost"
CACHE_REDIS_PORT = int(os.environ.get("CACHE_REDIS_PORT") or "6379")
CACHE_REDIS_DB = int(os.environ.get("CACHE_REDIS_DB") or "0")
CACHE_KEY_PREFIX = os.environ.get("CACHE_KEY_PREFIX") or "mylists_cache_"

If you are interested in contributing, your help is most welcome.

Crossoufire avatar Jan 02 '25 10:01 Crossoufire

Of course I didn't mean that in a bad way, I was just quite irritated.

For example, I couldn't start the backend without modifying it:

Traceback (most recent call last):
  File "/home/MyLists/backend/server.py", line 1, in <module>
    from backend.api import create_app
ModuleNotFoundError: No module named 'backend'

But I guess this is quite off topic.

mabezi avatar Jan 02 '25 10:01 mabezi

I would love to see this as a Docker!

loxoron218 avatar Jan 12 '25 16:01 loxoron218