Make project docker-ready

This commit is contained in:
Mark Veidemanis 2022-07-29 22:22:22 +01:00
parent b401fe939f
commit 755bc66844
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
3 changed files with 34 additions and 0 deletions

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
# syntax=docker/dockerfile:1
FROM python:3
RUN useradd -d /code pathogen
RUN mkdir /code
RUN chown pathogen:pathogen /code
RUN mkdir /venv
RUN chown pathogen:pathogen /venv
USER pathogen
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.prod.txt /code/
RUN python -m venv /venv
RUN . /venv/bin/activate && pip install -r requirements.prod.txt
CMD . /venv/bin/activate && exec python manage.py runserver 0.0.0.0:8000

15
docker-compose.yml Normal file
View File

@ -0,0 +1,15 @@
version: "2"
services:
app:
image: pathogen/neptune
build: .
volumes:
- .:/code
ports:
- "8000:8000"
networks:
default:
external:
name: pathogen

View File

@ -1,3 +1,4 @@
wheel
django django
pre-commit pre-commit
django-crispy-forms django-crispy-forms