Browse Source

Adiciona Docker para desenvolvimento (#3071)

Adiciona Dockerfile de desenvolvimento

Adiciona docker-compose de desenvolvimento
pull/3163/head
Vinícius Cantuária 5 years ago
committed by eribeiro
parent
commit
c11f25fd2f
  1. 42
      Dockerfile.dev
  2. 42
      docker-compose-dev.yml

42
Dockerfile.dev

@ -1,34 +1,8 @@
FROM alpine:3.8
ENV BUILD_PACKAGES postgresql-dev graphviz-dev graphviz build-base git pkgconfig \
python3-dev libxml2-dev jpeg-dev libressl-dev libffi-dev libxslt-dev \
nodejs py3-lxml py3-magic postgresql-client poppler-utils antiword \
curl jq openssh-client vim bash
RUN apk update --update-cache && apk upgrade
RUN apk --update add fontconfig ttf-dejavu && fc-cache -fv
RUN apk add --no-cache python3 nginx tzdata && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools && \
rm -r /root/.cache && \
rm -f /etc/nginx/conf.d/*
RUN mkdir -p /var/interlegis/sapl && \
apk add --update --no-cache $BUILD_PACKAGES
ADD . /var/interlegis/sapl/
WORKDIR /var/interlegis/sapl/
RUN pip install -r /var/interlegis/sapl/requirements/dev-requirements.txt --upgrade setuptools && \
rm -r /root/.cache
#RUN python3 manage.py collectstatic --noinput --clear
RUN chmod +x start_devel.sh
CMD ["/var/interlegis/sapl/start_devel.sh"]
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

42
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
Loading…
Cancel
Save