Skip to content

Commit 309895b

Browse files
Merge pull request #2 from patrickporto/docker
Ambiente utilizando Docker
2 parents 6bc7714 + af4f2e2 commit 309895b

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.6.4-alpine3.7
2+
3+
# Prepare environment
4+
RUN apk add --update git make gcc g++ python3-dev musl-dev postgresql-dev libuv-dev libffi-dev jpeg-dev zlib-dev
5+
6+
# Move to WORKDIR and copy files
7+
WORKDIR /usr/src/app
8+
ADD . .
9+
10+
# Install dependencies
11+
RUN set -ex && \
12+
pip install honcho && \
13+
pip install -r requirements.txt
14+
15+
CMD ["honcho", "start"]

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.PHONY: run
2+
3+
run:
4+
docker-compose up
5+
6+
run-debug:
7+
docker-compose run --services-ports pythonrio
8+
9+
migrate:
10+
docker-compose exec pythonrio python3 manage.py migrate
11+

docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3'
2+
3+
services:
4+
pythonrio-db:
5+
image: postgres:10.2-alpine
6+
ports:
7+
- "5432:5432"
8+
environment:
9+
- POSTGRES_USER=admin
10+
- POSTGRES_PASSWORD=adminpass
11+
- POSTGRES_DB=pythonrio
12+
13+
pythonrio:
14+
build:
15+
context: .
16+
ports:
17+
- "5000:5000"
18+
volumes:
19+
- .:/usr/src/app
20+
depends_on:
21+
- pythonrio-db
22+
env_file: .env

0 commit comments

Comments
 (0)