webpashtet / instapy-docker

🐳 Docker config and documentation for running InstaPy with Docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InstaPy-Docker 🐳

MIT license Docker Cloud Build Status Docker Pulls Backers on Open Collective Sponsors on Open Collective Discord

Table of contents

  1. Running InstaPy with docker
  2. Running InstaPy with docker-compose

Running InstaPy with docker

  • If you previously ran InstaPy the classical way you have to mount InstaPy logs folder, which is by default saved in your home directory ~/InstaPy, into the container otherwise you will loose all your previous data
  • Copy the quickstart example file from docker-compose directory to get started
  • Edit the file docker_quicktart.py to personalize how InstaPy will interact. All functions are the same than the classic installation mode. If you are new to InstaPy, we strongly suggest to have a look to InstaPy documentation to fully understand this file and how to modify it. Keep in mind all InstaPy functions should start with bot. when running with Docker.
  • Start InstaPy container
docker pull instapy/instapy:latest && \
docker run --name instapy \
  -v /absolute_path_to_file/docker_quickstart.py:/code/docker_quickstart.py \
  -v /absolute_path_to_file/InstaPy:/code/InstaPy \
  -d instapy/instapy:latest

Example:

docker pull instapy/instapy:latest && \
docker run --name instapy \
  -v /home/myuser/docker_quickstart.py:/code/docker_quickstart.py \
  -v /home/myuser/InstaPy:/code/InstaPy \
  -d instapy/instapy:latest
  • Stop InstaPy container
    docker stop instapy
  • Remove InstaPy container
    docker rm instapy
  • Display InstaPy output logs
    docker logs -f instapy or docker logs --tail 50 -f $(docker ps -a | grep instapy | cut -d " " -f 1)
  • Using specific version of InstaPy
    By default, you will use the latest version of InstaPy. For some reasons, if you want to run a specific version you could with adapting the starting command (see above) by replacing both latest with the desire released version of InstaPy. It will then start a container of InstaPy with the corresponding version.

Running InstaPy with docker-compose

  • Clone this repository
    git clone https://github.com/InstaPy/instapy-docker.git
  • Change your directory to docker-compose
    cd docker-compose
  • If you previously ran InstaPy the classical way you have to move InstaPy logs folder, which is by default saved in your home directory ~/InstaPy, into the current folder otherwise you will loose all your previous data
    mv ~/InstaPy .
  • Copy the quickstart example file to get started
    cp -a docker_quickstart.py.example docker_quickstart.py
  • Edit the file docker_quicktart.py to personalize how InstaPy will interact. All functions are the same than the classic installation mode. If you are new to InstaPy, we strongly suggest to have a look to InstaPy documentation to fully understand this file and how to modify it. Keep in mind all InstaPy functions should start with bot. when running with Docker.
  • Start InstaPy container
    docker-compose pull && docker-compose up -d --build web
  • Stop InstaPy container
    docker-compose stop web
  • Stop and remove Docker configs
    docker-compose down
  • Display InstaPy output logs
    docker logs -f instapy_web_1 or docker logs --tail 50 -f $(docker ps -a | grep instapy_web | cut -d " " -f 1)
  • Automatically run InstaPy or run it at a speified time (Example below: run it everyday at 8:30AM)
    • Edit your crontab file
    • Add 30 8 * * * root cd /path_to_repo/docker-compose/ && docker-compose up -d --build
  • Using specific version of InstaPy
    By default, you will use the latest version of InstaPy. For some reasons, if you want to run a specific version you have to edit docker-compose.ymlfile and replace latest with the desire released version in the line image: instapy/instapy:latest. It will then start a container of InstaPy with the corresponding version.

About

🐳 Docker config and documentation for running InstaPy with Docker

License:GNU General Public License v3.0


Languages

Language:Dockerfile 53.1%Language:Shell 46.9%