diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..237943fbc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +# Git +.git +.gitignore + +# Docker +.docker + +# Python +app/__pycache__/ +app/*/__pycache__/ +app/*/*/__pycache__/ +app/*/*/*/__pycache__/ +.env/ +.venv/ +venv/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..b563eab33 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.9-alpine3.13 +LABEL maintainer="londonappdeveloper.com" + +ENV PYTHONUNBUFFERED 1 + +COPY ./requirements.txt /tmp/requirements.txt +COPY ./app /app +WORKDIR /app +EXPOSE 8000 + +RUN python -m venv /py && \ + /py/bin/pip install --upgrade pip && \ + /py/bin/pip install -r /tmp/requirements.txt && \ + rm -rf /tmp && \ + adduser \ + --disabled-password \ + --no-create-home \ + django-user + +ENV PATH="/py/bin:$PATH" + +USER django-user