Commit 240fe505 authored by Álax Alves's avatar Álax Alves

Adding docker envirnment for development

parent 98e96d70
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN apt-get update && \
apt-get install -y \
libpq-dev \
python3 \
python3-pip \
postgresql \
postgresql-client \
pkg-config \
python-psycopg2 \
python-matplotlib \
python3-cffi \
libfreetype6-dev
COPY . /SMI-UnB
WORKDIR /SMI-UnB
RUN pip install -r requirements.txt
#!/bin/sh
while ! pg_isready -h $DB_SERVICE -p $DB_PORT -q -U $DB_USER; do
>&2 echo "Postgres is unavailable - sleeping..."
sleep 1
done
>&2 echo "Postgres is up - executing commands..."
python manage.py makemigrations
python manage.py migrate
python manage.py loaddata src/smi_unb/fixtures/initial_data.json
python3 manage.py runserver 0.0.0.0:3000
\ No newline at end of file
version: '3.5'
services:
db:
container_name: smi-db
image: postgres:9.6
ports:
- 5431:5432
networks:
- smi-unb
web:
container_name: smi-app
build: .
command: bash -c "./django-setup.sh"
environment:
- DB_NAME=postgres
- DB_USER=postgres
- DB_PASS=password
- DB_SERVICE=db
- DB_PORT=5432
volumes:
- .:/SMI-UnB
ports:
- 3000:3000
depends_on:
- db
networks:
- smi-unb
networks:
smi-unb:
name: smi-unb
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment