Skip to content

Commit

Permalink
Django with PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
willianantunes committed Mar 16, 2019
1 parent 4ca9f9e commit e2ce496
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.7.2-slim-stretch

WORKDIR /app

COPY . /app

RUN pip3 install --upgrade pip==19.0.3 && \
pip3 install -r requirements.txt
30 changes: 30 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "2.4"
services:
db:
image: postgres:10.1-alpine
app:
build: .
volumes:
- .:/app
depends_on:
- db
environment:
- DJANGO_BIND_ADDRESS=0.0.0.0
- DJANGO_BIND_PORT=80
- DB_ENGINER=django.db.backends.postgresql
- DB_DATABASE=postgres
- DB_USER=postgres
- DB_HOST=db
- DB_PORT=5432
ports:
- "8000:80"
mem_limit: 256mb
command:
[
"scripts/wait-for-it.sh",
"db:5432",
"-t",
"20",
"--",
"scripts/start.sh",
]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Django==2.1.7
djangorestframework==3.9.2
psycopg2-binary==2.7.7
django-filter==2.1.0
drf-extensions==0.4.0
graphene-django==2.2.0
Expand Down

0 comments on commit e2ce496

Please sign in to comment.