Skip to content
This repository has been archived by the owner on Feb 28, 2018. It is now read-only.

Commit

Permalink
Merge branch 'master' into cuducos-public-admin-architecture-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
cuducos committed Oct 23, 2017
2 parents 32ecc2f + 9d31da5 commit 4d89418
Show file tree
Hide file tree
Showing 67 changed files with 4,632 additions and 2,956 deletions.
2 changes: 0 additions & 2 deletions .buildpacks

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.sqlite3
htmlcov/
npm-debug.log
db/

# cache, compiled & downloaded files
*.pyc
Expand Down
19 changes: 0 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ language: python
python:
- 3.5

cache:
directories:
- sysconfcpus

addons:
postgresql: "9.6"

Expand All @@ -19,32 +15,17 @@ env:
- DATABASE_URL="postgres://postgres@localhost/jarbas"

before_install:
- |
if [ ! -d sysconfcpus/bin ];
then
git clone https://github.com/obmarg/libsysconfcpus.git;
cd libsysconfcpus;
./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus;
make && make install;
cd ..;
fi
- nvm install 6
- nvm use 6
- npm install -g yarn
- python -m pip install -U pip

install:
- psql -U postgres -c 'create database "jarbas";'
- yarn install
- python -m pip install -r requirements-dev.txt coveralls

before_script:
- $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 yarn assets
- python manage.py migrate
- python manage.py collectstatic --no-input

script:
- $TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 yarn test
- coverage run manage.py test -v 3

after_success:
Expand Down
38 changes: 28 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
FROM python:3.5
COPY requirements.txt /requirements.txt
COPY requirements-dev.txt /requirements-dev.txt
RUN python -m pip install -U pip
RUN python -m pip install -r requirements-dev.txt
RUN apt-get update && apt-get install -y postgresql postgresql-contrib
FROM python:3.5.4-alpine
ENV PYTHONUNBUFFERED 1

# set timezone
RUN apk update && apk add --no-cache tzdata && \
cp /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime && \
echo "America/Sao_Paulo" > /etc/timezone

# pyscopg2 dependencies
RUN apk update && apk add --no-cache \
gcc \
musl-dev \
postgresql-dev \
python3-dev

# install git so we can pip install from github repos
RUN apk update && apk add --no-cache git

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt
COPY ./requirements-dev.txt /code/requirements-dev.txt
RUN python -m pip install -U pip && \
python -m pip install -r requirements-dev.txt

COPY manage.py /code/manage.py
COPY jarbas /code/jarbas
WORKDIR /code
RUN echo "America/Sao_Paulo" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata
VOLUME /code/staticfiles
CMD ["gunicorn", "jarbas.wsgi:application", "--reload", "--bind", "0.0.0.0:8001", "--workers", "4"]
RUN python manage.py collectstatic --no-input

CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
20 changes: 13 additions & 7 deletions Dockerfile-elm
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM node:6.9.1
FROM node:8.4.0

# npm5 issue with updating itself: https://github.com/npm/npm/issues/18278
# RUN npm install -g npm@latest

RUN npm install yarn
RUN ln -s /node_modules/yarn/bin/yarn.js /usr/bin/yarn
WORKDIR /code

COPY yarn.lock yarn.lock
COPY package.json package.json
COPY package-lock.json package-lock.json
COPY elm-package.json elm-package.json
COPY gulpfile.js gulpfile.js
RUN yarn install --pure-lockfile

COPY jarbas jarbas
CMD ["yarn", "assets"]
RUN npm install

# npm5 issue w/ postinstall: https://github.com/npm/npm/issues/17316
RUN ./node_modules/.bin/elm-package install --yes

COPY ./jarbas /code/jarbas

CMD ["npm", "run", "watch"]
6 changes: 4 additions & 2 deletions Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
FROM nginx:1.11.5
FROM nginx:1.13.3-alpine

COPY contrib/nginx.docker /etc/nginx/conf.d/default.conf
RUN mkdir -p /opt/jarbas

RUN mkdir -p /code/staticfiles
18 changes: 0 additions & 18 deletions Makefile

This file was deleted.

1 change: 0 additions & 1 deletion Procfile

This file was deleted.

Loading

0 comments on commit 4d89418

Please sign in to comment.