Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adiciona Docker para desenvolvimento (#3071)
Adiciona Dockerfile de desenvolvimento Adiciona docker-compose de desenvolvimento
- Loading branch information
1 parent
15b2535
commit c11f25f
Showing
2 changed files
with
50 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |