From de472c2823e90e8f93f3aa58225f62ae27eab1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Cantu=C3=A1ria?= Date: Mon, 9 Mar 2020 13:12:02 -0300 Subject: [PATCH] Adiciona Docker para desenvolvimento (#3071) Adiciona Dockerfile de desenvolvimento Adiciona docker-compose de desenvolvimento --- Dockerfile.dev | 8 ++++++++ docker-compose-dev.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Dockerfile.dev create mode 100644 docker-compose-dev.yml diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 000000000..bac7d6f85 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,8 @@ +FROM python:3.7 +ENV PYTHONUNBUFFERED 1 +WORKDIR /sapl-dev +COPY requirements ./requirements/ +RUN apt update && \ + apt -y install graphviz-dev && \ + pip install -r ./requirements/dev-requirements.txt +EXPOSE 8000 \ No newline at end of file diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml new file mode 100644 index 000000000..e7a2f5f21 --- /dev/null +++ b/docker-compose-dev.yml @@ -0,0 +1,42 @@ +version: '3.5' + +services: + sapldb-dev: + container_name: sapldb-dev + image: postgres:10.5-alpine + restart: always + environment: + POSTGRES_PASSWORD: sapl + POSTGRES_USER: sapl + POSTGRES_DB: sapl + ports: + - "5433:5432" + networks: + - sapl-net-dev + + sapl-dev: + container_name: sapl-dev + restart: always + image: sapl:dev + build: + context: . + dockerfile: Dockerfile.dev + command: python3 manage.py runserver 0:8000 + volumes: + - .:/sapl-dev + ports: + - "8000:8000" + environment: + SECRET_KEY: '$dkhxm-$zvxdox$g2-&w^1i!_z1juq0xwox6e3#gy6w_88!3t^' + DEBUG: 'True' + DATABASE_URL: postgresql://sapl:sapl@sapldb-dev:5432/sapl + TZ: America/Sao_Paulo + depends_on: + - sapldb-dev + networks: + - sapl-net-dev + +networks: + sapl-net-dev: + name: sapl-net-dev + driver: bridge