Skip to content

Ambiente utilizando Docker #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.6.4-alpine3.7

# Prepare environment
RUN apk add --update git make gcc g++ python3-dev musl-dev postgresql-dev libuv-dev libffi-dev jpeg-dev zlib-dev

# Move to WORKDIR and copy files
WORKDIR /usr/src/app
ADD . .

# Install dependencies
RUN set -ex && \
pip install honcho && \
pip install -r requirements.txt

CMD ["honcho", "start"]
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: run

run:
docker-compose up

run-debug:
docker-compose run --services-ports pythonrio

migrate:
docker-compose exec pythonrio python3 manage.py migrate

22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3'

services:
pythonrio-db:
image: postgres:10.2-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=adminpass
- POSTGRES_DB=pythonrio

pythonrio:
build:
context: .
ports:
- "5000:5000"
volumes:
- .:/usr/src/app
depends_on:
- pythonrio-db
env_file: .env