Skip to content

Commit

Permalink
Merge pull request #255 from ramonsaraiva/dockerize
Browse files Browse the repository at this point in the history
Dockerize the demo app
  • Loading branch information
idlesign committed Sep 17, 2018
2 parents a6f0693 + 67a374e commit 6ef368b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
7 changes: 7 additions & 0 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.7-alpine

ADD . /code
WORKDIR /code

ADD requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
19 changes: 14 additions & 5 deletions demo/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,24 @@ Expects Django 1.11+
How to run
----------

1. From sitetree root sources directory:
Docker
~~~~~~

.. code:: bash
1. Run `docker-compose up`
2. Go to http://localhost:8000

$ demo/manage.py runserver
Manually
~~~~~~~~

2. Go to http://localhost:8000
1. Install the requirements with `pip install -r requirements.txt`
2. Run the server `python manage.py runserver`
3. Go to http://localhost:8000

Admin
~~~~~

3. Admin (http://localhost:8000/admin/) credentials:
Admin (http://localhost:8000) credentials:

Login: `demo`
Password: `demodemo`

Binary file modified demo/db.sqlite3
Binary file not shown.
11 changes: 11 additions & 0 deletions demo/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'

services:
web:
restart: always
build: .
command: sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- "8000:8000"
2 changes: 2 additions & 0 deletions demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Django==2.1.1
django-sitetree==1.11

0 comments on commit 6ef368b

Please sign in to comment.