De Wiki inetshell
Saltar a: navegación, buscar
  • docker-compose.yml:
version: '2'

services:
  web:
    container_name: web
    build: web
    command: python3 manage.py runserver 0.0.0.0:8000
    volumes:
      - ./web/:/code/:Z
    env_file:
      - secrets/web.env
    ports:
      - "127.0.0.1:8000:8000"
  • Dockerfile:
FROM python:3

ENV PYTHONUNBUFFERED 1

WORKDIR /code

COPY requirements.txt /code/

RUN pip install -r requirements.txt

COPY ssh/* /root/.ssh/

COPY . /code/
  • requirements.txt:
Django==2.0.6
psycopg2-binary
  • Inicia docker
docker-compose run web django-admin.py startproject project .


checar[editar]

docker-compose run api python manage.py startapp nodes
docker-compose run api python manage.py check
docker-compose run api python manage.py makemigrations nodes
docker-compose run api python manage.py sqlmigrate nodes 0001
docker-compose run api python manage.py migrate