Answers for "dockerize django app"

0

dockerize django app

# syntax=docker/dockerfile:1
FROM python:3
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY . /code/
Posted by: Guest on August-01-2021
0

dockerize django app

version: "3.9"
   
services:
  db:
    image: postgres
    volumes:
      - ./data/db:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
  web:
    build: .
    command: python manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    depends_on:
      - db
Posted by: Guest on August-01-2021
0

how to deploy django based website using docker

$ docker run -it -p 8020:8020 \
     -e DJANGO_SUPERUSER_USERNAME=admin \
     -e DJANGO_SUPERUSER_PASSWORD=sekret1 \
     -e [email protected] \
     django-markdown-editor

Superuser created successfully
[2020-01-24 00:00:47 +0000] [8] [INFO] Starting gunicorn 20.0.4
[2020-01-24 00:00:47 +0000] [8] [INFO] Listening at: http://0.0.0.0:8010 (8)
[2020-01-24 00:00:47 +0000] [8] [INFO] Using worker: sync
[2020-01-24 00:00:47 +0000] [15] [INFO] Booting worker with pid: 15
[2020-01-24 00:00:47 +0000] [16] [INFO] Booting worker with pid: 16
[2020-01-24 00:00:47 +0000] [17] [INFO] Booting worker with pid: 17
Posted by: Guest on July-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language