Skip to content

Commit

Permalink
Add postgres db service
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorcx committed Sep 23, 2019
1 parent 410c2cc commit 94085e9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POSTGRES_USER=acacia
POSTGRES_PASSWORD=acacia
POSTGRES_DB=acacia
POSTGRES_HOST=db
PGDATA=/tmp/data
DB_NAME=acacia
29 changes: 25 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
version: '3'
version: '3.7'
services:

db:
image: postgres:11.5
container_name: acacia_db
env_file:
- .env
ports:
- "5432:5432"
networks:
- acacia_network

acacia-back:
container_name: acacia-backend
container_name: acacia_backend
build:
context: .
dockerfile: Dockerfile
Expand All @@ -11,6 +22,16 @@ services:
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8080"
ports:
- "8080:8080"
- "8080:8080"
volumes:
- .:/code
- .:/code
env_file:
- .env
networks:
- acacia_network
depends_on:
- db

networks:
acacia_network:
name: acacia_network
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Django==2.2.4
djangorestframework==3.10.0
djangorestframework==3.10.0
psycopg2==2.8.3

0 comments on commit 94085e9

Please sign in to comment.