Skip to content

Commit

Permalink
Update dockerfile with autorun script
Browse files Browse the repository at this point in the history
  • Loading branch information
Elucidation committed Feb 26, 2017
1 parent 3a05dc8 commit 018b8e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ RUN pip install --upgrade praw
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY . /tmp/sb/
# Once the docker instance is up, copy over your praw.ini file for credentials
# into /tmp/sb
# Then manually start the script from inside in headless mode using:
# <machine>$ docker exec -it <container> /bin/bash
# <docker>$ cd /tmp/sb
# <docker>$ nohup python -u schmeckle_bot.py > out.log 2> out_error.log &

# Copy code over
COPY . /sb/

WORKDIR /sb

# Run schmecklebot by default
CMD ["/sb/run_sb.sh"]
3 changes: 3 additions & 0 deletions run_sb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
log_name=`date +"%F_%H-%M-%S"`
python -u ./schmeckle_bot.py > ./out_$log_name.log 2> ./error_$log_name.log

0 comments on commit 018b8e8

Please sign in to comment.