mirror of https://github.com/interlegis/sigi.git
Lude Ribeiro
3 years ago
5 changed files with 24 additions and 46 deletions
@ -1,24 +1,13 @@ |
|||||
#FROM ubuntu |
|
||||
#FROM python:3 |
|
||||
#ENV PYTHONDONTWRITEBYTECODE=1 |
|
||||
#ENV PYTHONUNBUFFERED=1 |
|
||||
#CMD apt install update |
|
||||
#CMD apt install upgrade -y |
|
||||
#CMD apt install build-essential python3-dev graphviz libgraphviz-dev pkg-config libpq-dev -y |
|
||||
#RUN pip install --upgrade pip |
|
||||
#COPY . /dck/ |
|
||||
#RUN pip install -r dck/requirements/dev-requirements.txt |
|
||||
#CMD python ./manage.py runserver |
|
||||
|
|
||||
FROM python:3 |
FROM python:3 |
||||
ENV PYTHONDONTWRITEBYTECODE=1 |
ENV PYTHONDONTWRITEBYTECODE=1 |
||||
ENV PYTHONUNBUFFERED=1 |
ENV PYTHONUNBUFFERED=1 |
||||
RUN apt update |
RUN apt update |
||||
RUN apt upgrade -y |
RUN apt upgrade -y |
||||
RUN apt install build-essential python3-dev graphviz libgraphviz-dev pkg-config libpq-dev -y |
RUN apt install build-essential python3-dev graphviz libgraphviz-dev pkg-config libpq-dev -y |
||||
RUN pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
|
||||
RUN pip install --upgrade pip |
RUN pip install --upgrade pip |
||||
WORKDIR /code |
WORKDIR /code |
||||
COPY . /code/ |
COPY . /code/ |
||||
|
#RUN pg_ctl -D /var/lib/postgresql/data -l logfile start |
||||
|
# RUN --mount=type=cache,target=/root/.cache/pip pip install -r /code/requirements/dev-requirements.txt |
||||
RUN pip install -r /code/requirements/dev-requirements.txt |
RUN pip install -r /code/requirements/dev-requirements.txt |
||||
RUN service pstgresql start |
RUN python manage.py migrate |
@ -1,32 +1,26 @@ |
|||||
version: "3" |
version: "3.3" |
||||
|
|
||||
services: |
services: |
||||
db: |
db: |
||||
image: postgres |
image: postgres:12.9 |
||||
volumes: |
volumes: |
||||
- ./data/db:/usr/local/var/postgresql/sigi |
- ./data/db:/var/lib/postgresql/data |
||||
environment: |
environment: |
||||
- POSTGRES_NAME=postgres |
- POSTGRES_NAME=postgres |
||||
- POSTGRES_USER=sigi |
- POSTGRES_USER=sigi |
||||
- POSTGRES_PASSWORD=sigi |
- POSTGRES_PASSWORD=123456 |
||||
web: |
code: |
||||
build: . |
build: . |
||||
command: python manage.py runserver 0.0.0.0:8000 |
command: python manage.py runserver 0.0.0.0:8000 |
||||
volumes: |
volumes: |
||||
- .:/code |
- .:/code |
||||
ports: |
ports: |
||||
- "8001:8000" |
- "8000:8000" |
||||
environment: |
|
||||
- POSTGRES_NAME=sigi |
|
||||
- POSTGRES_USER=sigi |
|
||||
- POSTGRES_PASSWORD=sigi |
|
||||
depends_on: |
|
||||
- postgres |
|
||||
postgres: |
|
||||
image: postgres:12.9 |
|
||||
ports: |
|
||||
- "5433:5432" |
|
||||
environment: |
environment: |
||||
|
- DB_HOST=db |
||||
- POSTGRES_NAME=postgres |
- POSTGRES_NAME=postgres |
||||
- POSTGRES_USER=sigi |
- POSTGRES_USER=sigi |
||||
- POSTGRES_PASSWORD=sigi |
- POSTGRES_PASSWORD=132456 |
||||
|
depends_on: |
||||
|
- db |
||||
|
|
||||
|
@ -1,14 +0,0 @@ |
|||||
import os |
|
||||
|
|
||||
[...] |
|
||||
|
|
||||
DATABASES = { |
|
||||
'default': { |
|
||||
'ENGINE': 'django.db.backends.postgresql', |
|
||||
'NAME': os.environ.get('POSTGRES_NAME'), |
|
||||
'USER': os.environ.get('POSTGRES_USER'), |
|
||||
'PASSWORD': os.environ.get('POSTGRES_PASSWORD'), |
|
||||
'HOST': 'db', |
|
||||
'PORT': 5432, |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,9 @@ |
|||||
|
DATABASES = { |
||||
|
'default': { |
||||
|
'ENGINE': 'django.db.backends.postgresql_psycopg2', |
||||
|
'NAME': 'sigi', |
||||
|
'USER': 'sigi', |
||||
|
'PASSWORD': '123456', |
||||
|
'HOST': 'db', |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue