Skip to content

Commit

Permalink
Containerized the AutoTweetLiker application
Browse files Browse the repository at this point in the history
Signed-off-by: cankush625 <[email protected]>
  • Loading branch information
cankush625 committed Apr 15, 2020
1 parent f47789a commit ce3f7aa
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 2 deletions.
Binary file modified AutoTweetLiker/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified AutoTweetLiker/__pycache__/settings.cpython-37.pyc
Binary file not shown.
Binary file modified AutoTweetLiker/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file modified AutoTweetLiker/__pycache__/wsgi.cpython-37.pyc
Binary file not shown.
Binary file modified AutoTweetLiker/mysite.sqlite3
Binary file not shown.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.7-alpine

ENV PYTHONONBUFFERED 1

RUN mkdir /code
WORKDIR /code
COPY . /code/
RUN pip install -r requirements.txt
Binary file modified auto_tweet_liker/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified auto_tweet_liker/__pycache__/admin.cpython-37.pyc
Binary file not shown.
Binary file modified auto_tweet_liker/__pycache__/apps.cpython-37.pyc
Binary file not shown.
Binary file modified auto_tweet_liker/__pycache__/models.cpython-37.pyc
Binary file not shown.
Binary file modified auto_tweet_liker/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file modified auto_tweet_liker/__pycache__/utils.cpython-37.pyc
Binary file not shown.
Binary file modified auto_tweet_liker/__pycache__/views.cpython-37.pyc
Binary file not shown.
Binary file modified auto_tweet_liker/migrations/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
5 changes: 3 additions & 2 deletions auto_tweet_liker/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import tweepy
import os

#Application key
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
CONSUMER_KEY = os.getenv("CONS_KEY")
CONSUMER_SECRET = os.getenv("CONS_SECRET")

def get_api(request):
# set up and return a twitter api object
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'

services:
web:
build: .
# Exporting CONSUMER KEY and CONSUMER SECRET key from tweeter api as an environment variable
command: sh -c "export CONS_KEY=""
&& export CONS_SECRET=""
&& python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- "8000:8000"
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit ce3f7aa

Please sign in to comment.