diff --git a/Dockerfile b/Dockerfile index 87e67f4..e5a22b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,6 @@ COPY .env /code/.env COPY manage.py /code/manage.py COPY jarbas /code/jarbas WORKDIR /code -RUN python manage.py migrate -RUN python manage.py ceapdatasets 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"] diff --git a/Dockerfile-elm b/Dockerfile-elm index a13726d..b93db24 100644 --- a/Dockerfile-elm +++ b/Dockerfile-elm @@ -3,7 +3,9 @@ COPY elm-package.json elm-package.json COPY package.json package.json COPY gulpfile.js gulpfile.js COPY jarbas jarbas +COPY contrib/copyassets.sh copyassets.sh +RUN chmod +x copyassets.sh RUN npm install VOLUME /assets RUN npm run assets -CMD ["cp", "-r", "jarbas/frontend/static/*", "/assets"] +CMD ["./copyassets.sh"] diff --git a/Makefile b/Makefile index 73dbc00..310c603 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ run.jarbas: - docker-compose up -d + docker-compose up -d --build + docker-compose run --rm jarbas python manage.py migrate + docker-compose run --rm jarbas python manage.py ceapdatasets collectstatic: run.jarbas docker-compose run --rm jarbas python manage.py collectstatic --no-input diff --git a/README.md b/README.md index 092eabd..1b85a1c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Jarbas is in charge of making data from [CEAP](https://github.com/datasciencebr/ 1. [Installing](#installing) 1. [Using Docker](#using-docker) 1. [Local install](#local-install) - + ## JSON API endpoints ### Reimbursement @@ -128,10 +128,12 @@ There is also a [tapioca-wrapper](https://github.com/vintasoftware/tapioca-wrapp ### Using Docker -If you have [Docker](https://docs.docker.com/engine/installation/) (with [Docker Compose](https://docs.docker.com/compose/install/)) and make, jusr run: +If you have [Docker](https://docs.docker.com/engine/installation/) (with [Docker Compose](https://docs.docker.com/compose/install/)) and make, just run: ```console -$ docker-compose up -d +$ docker-compose up -d --build +$ docker-compose run --rm jarbas python manage.py migrate +$ docker-compose run --rm jarbas python manage.py ceapdatasets ``` @@ -244,4 +246,4 @@ $ python manage.py test #### Ready! -Run the server with `$ python manage.py runserver` and load [localhost:8000](http://localhost:8000) in your favorite browser. \ No newline at end of file +Run the server with `$ python manage.py runserver` and load [localhost:8000](http://localhost:8000) in your favorite browser. diff --git a/contrib/copyassets.sh b/contrib/copyassets.sh new file mode 100644 index 0000000..b1653f1 --- /dev/null +++ b/contrib/copyassets.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cp -r /jarbas/frontend/static/* /assets/