Skip to content
Open
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
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.4-alpine

RUN apk update && apk add --no-cache \
jpeg-dev \
zlib-dev

WORKDIR /app

COPY requirements.txt /app

RUN pip install --upgrade pip
RUN pip install -r requirements.txt

COPY . /app

EXPOSE 8000
RUN chmod +x runner/django_run.sh

ENTRYPOINT ["/bin/sh", "runner/django_run.sh"]
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- "8000:8000"
volumes:
- ./:/app
6 changes: 6 additions & 0 deletions runner/django_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

python3 src/manage.py makemigrations
python3 src/manage.py migrate
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'admin')" | python3 src/manage.py shell
python3 src/manage.py runserver 0.0.0.0:8000