From 9b352582a315dce61734b0b72e9238d00ee5a31a Mon Sep 17 00:00:00 2001 From: Yohann D'anello Date: Sun, 2 Feb 2020 18:22:28 +0100 Subject: [PATCH] Docker --- Dockerfile | 18 ++++++++++++++++++ entrypoint.sh | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2c84082 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3-buster + +ENV PYTHONUNBUFFERED 1 + +RUN mkdir /code +WORKDIR /code + +RUN apt update && \ + apt install -y gettext nginx uwsgi uwsgi-plugin-python3 && \ + rm -rf /var/lib/apt/lists/* + +COPY requirements.txt /code/ +RUN pip install -r requirements.txt + +COPY . /code/ + +ENTRYPOINT ["/code/entrypoint.sh"] +EXPOSE 8000 diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..b9fb7ae --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +python manage.py compilemessages +python manage.py makemigrations +python manage.py migrate + +# TODO: use uwsgi in production +python manage.py runserver 0.0.0.0:8000