Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adicionado dockerfile #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:latest
COPY . /socios-brasil
USER root
ARG mirror=false
ARG censorship=true
ARG import=false
ARG database_url=false
ENV tz=America

RUN apt-get update \
&& ln -snf /usr/share/zoneinfo/$tz /etc/localtime \
&& echo $tz \
&& apt-get install git wget aria2 python3 python3-pip postgresql-client -y \
&& cd /socios-brasil \
&& pip3 install -r requirements.txt \
&& pip3 install rows[cli] \
&& pip3 install rows[postgresql] \
&& pip3 install -U https://github.com/turicas/rows/archive/develop.zip

RUN cd /socios-brasil && ./run.sh --use-mirror --no_censorship
RUN export DATABASE_URL = $database_url \
&& rows pgimport --schema=schema/empresa.csv data/output/empresa.csv.gz $DATABASE_URL empresa \
&& rows pgimport --schema=schema/socio.csv data/output/holding.csv.gz $DATABASE_URL empresa_socia \
&& rows pgimport --schema=schema/socio.csv data/output/socio.csv.gz $DATABASE_URL socio \
&& rows pgimport --schema=schema/cnae-secundaria.csv data/output/cnae-secundaria.csv.gz $DATABASE_URL cnae-secundaria