Python rest Docker

Python rest_framework Docker setup

Dockerfile

FROM python:3

ENV PYTHONUNBUFFERED = 1
RUN mkdir /code
WORKDIR /code
COPY . /code/
RUN pip install -r requirements.txt

docker-compose.yml

version: '3'

services:
  web:
    build: .
    command: python src/profiles_project/manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - "8000:8000"

docker-compose run web python src/profiles_project/manage.py migrate

docker-compose up

Subscribe to RSS - Python rest Docker