1# syntax=docker/dockerfile:1
2FROM python:3
3ENV PYTHONUNBUFFERED=1
4WORKDIR /code
5COPY requirements.txt /code/
6RUN pip install -r requirements.txt
7COPY . /code/
8
1version: "3.9"
2
3services:
4 db:
5 image: postgres
6 volumes:
7 - ./data/db:/var/lib/postgresql/data
8 environment:
9 - POSTGRES_DB=postgres
10 - POSTGRES_USER=postgres
11 - POSTGRES_PASSWORD=postgres
12 web:
13 build: .
14 command: python manage.py runserver 0.0.0.0:8000
15 volumes:
16 - .:/code
17 ports:
18 - "8000:8000"
19 depends_on:
20 - db
21
1$ docker run -it -p 8020:8020 \
2 -e DJANGO_SUPERUSER_USERNAME=admin \
3 -e DJANGO_SUPERUSER_PASSWORD=sekret1 \
4 -e DJANGO_SUPERUSER_EMAIL=admin@example.com \
5 django-markdown-editor
6
7Superuser created successfully
8[2020-01-24 00:00:47 +0000] [8] [INFO] Starting gunicorn 20.0.4
9[2020-01-24 00:00:47 +0000] [8] [INFO] Listening at: http://0.0.0.0:8010 (8)
10[2020-01-24 00:00:47 +0000] [8] [INFO] Using worker: sync
11[2020-01-24 00:00:47 +0000] [15] [INFO] Booting worker with pid: 15
12[2020-01-24 00:00:47 +0000] [16] [INFO] Booting worker with pid: 16
13[2020-01-24 00:00:47 +0000] [17] [INFO] Booting worker with pid: 17
14