Commit f5de4364 authored by Odair M.'s avatar Odair M. Committed by msrr18

#190: coloca apt-get update -qq e apt-get install em um unico estágio do...

#190: coloca apt-get update -qq e apt-get install em um unico estágio do docker build, pois de acordo com https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ deixar apt-get update em estágio separado pode deixar o estágio do apt install instável
parent 500055cc
[[source]]
name = "pypi"
verify_ssl = true
url = "https://pypi.python.org/simple"
[dev-packages]
coverage = "*"
ipython = "*"
[packages]
Django = "==1.11.10"
django-widget-tweaks = "*"
pandas = "==0.22"
xlrd = "*"
django-extensions = "*"
ujson = "*"
eventlet = "*"
gunicorn = "*"
"psycopg2" = "*"
This diff is collapsed.
#!/usr/bin/bash
(cd src; python manage.py collectstatic)
if ! sudo -u postgres psql adega
then
sudo -u postgres psql < postgres/create.sql
fi
python manage.py migrate
docker_scripts/docker-compose.yml
\ No newline at end of file
FROM python:3.5
RUN apt-get update -qq
RUN apt-get install -y \
python3-pip libpq-dev \
RUN apt-get update -qq && apt-get install -y \
python3-pip libpq-dev \
postgresql-client
RUN mkdir /adega
WORKDIR /adega
# Not necessary (only do the build slow)
# ADD . /adega
ADD ./requirements.txt /adega/requirements.txt
......
import os
import pandas as pd
import pathlib
#import django
#sys.path.append(os.getcwd())
#os.environ["DJANGON_SETTINGS_MODULE"] = "adega.settings"
#django.setup()
#from degree.models import *
#from student.models import *
#from course.models import *
#from admission.models import *
#from klass.models import *
def start():
directory = os.fsencode('relatorios')
# path = Path(str(directory))
# print(path)
for path, subdirs, files in os.walk(directory):
# print(subdirs)
# print(pathlib.PurePath(str(p), 'teste'))
# print(pathlib.PurePath(
for f in files:
print(f)
file_path = pathlib.PurePath(str(path), str(f))
print(pathlib.PurePath(str(path), str(f)))
file_open(file_path)
# print(pathlib.PurePath(path, str(f)))
def file_open(path):
if str(path).find('csv'):
print('csv')
return pd.read_csv(str(path))
else:
print('excel')
return pd.read_excel(str(path))
if __name__ == '__main__':
start()
CREATE DATABASE adega;
-- ~ CREATE USER adega WITH PASSWORD 'adega';
-- ~ ALTER ROLE adega SET client_encoding TO 'utf8';
-- ~ ALTER ROLE adega SET default_transaction_isolation TO 'read committed';
-- ~ ALTER ROLE adega SET timezone TO 'UTC-3';
-- ~ GRANT ALL PRIVILEGES ON DATABASE adega TO adega;
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