@PabloVallejo
@PabloVallejo_
tappsi.co
An open platform for distributed applications
From: https://speakerdeck.com/asm89/docker
Docker Toolbox
Folder structure
docker-django/
├── app/
├── __init__.py
├── local_settings.py
├── settings.py
├── urls.py
├── view.py
└── wsgi.py
├── Dockerfile
├── docker-compose.yml
├── manage.py
└── requirements.txt
App settings
Django commands
Dependencies
Docker setup files
FROM python:3.5.1
RUN apt-get update
RUN easy_install -U pip
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/requirements.txt
RUN pip install -r requirements.txt
# FROM: Get image from docker index
# RUN: Run commands inside container
Dockerfile
db:
image: postgres:9.5.0
volumes:
- .:/tmp/data/
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
links:
- db
# Django server
# Share this folder
# Get Postgres image
docker-compose.yml
# Build project
docker-compose build
Compose commands
# Run project
docker-compose up