veekun / pokedex

more than you ever wanted to know about Pokémon
MIT License
1.44k stars 637 forks source link

feature: added Docker support #208

Closed route1rodent closed 7 years ago

route1rodent commented 7 years ago

With Docker support, all requirements (python, etc) are provided by the Docker container itself, kind of a virtual machine, but consuming less space (~ 300MB) and less memory. This solution also installs the bin/pokedex automatically for you, if not found.

The docker-pokedex executable acts as a wrapper between the Docker container and the real bin/pokedex.

This way, setting up the project becomes as simple as running:

./docker-pokedex setup

You can also run any pokedex command the same way:

./docker-pokedex lookup eevee

Or any other Debian commands via exec:

./docker-pokedex exec ls -la

The docker-compose.yml configuration file also brings extendability for example, by adding a PostgreSQL or MySQL docker container.

It's also a place where to add any environment variable like POKEDEX_INDEX_DIR or POKEDEX_DB_ENGINE like:

version: '3'
services:
  pokedex:
    build: ./
    environment:
       POKEDEX_INDEX_DIR: "/project/pokedex/data/whoosh-index"
       POKEDEX_DB_ENGINE: "sqlite:////project/pokedex/data/pokedex.sqlite"
    volumes:
      - ./:/project
eevee commented 7 years ago

I doubt I'll maintain this myself, but I'm not opposed to having support included.