Skip to content

Initial docker setup #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.7'

services:
newsdiffs:
build:
context: ./
dockerfile: ./docker/dockerfile
volumes:
- ./:/app
ports:
- 8000:8000
12 changes: 12 additions & 0 deletions docker/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:2.7

COPY . /app/.

WORKDIR /app

RUN pip install -r requirements.txt && \
python website/manage.py syncdb && \
python website/manage.py migrate && \
mkdir articles

ENTRYPOINT ["python", "website/manage.py", "runserver", "0.0.0.0:8000"]
2 changes: 1 addition & 1 deletion website/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings")
sys.path.append(os.path.dirname(os.getcwd()))
sys.path.append(os.getcwd())
from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)