Closed cuducos closed 6 years ago
Ok, let's test this PR:
Clone the project:
$ git clone git@github.com:datasciencebr/jarbas.git
Change to Jarbas folder:
$ cd jarbas
Change to @cuducos branch:
$ git fetch origin
$ git checkout -b cuducos-slim-docker-elm origin/cuducos-slim-docker-elm
$ git merge master
Edit docker-compose.yml
to use Dockerfile-elm
file instead of pulling datasciencebr/jarbas-frontend
.
Build containers, run Jarbas and check if Layers (localhost:8000/layers/) doesn't crash:
$ cp contrib/.env.sample .env
$ docker-compose up -d
$ docker-compose run --rm django python manage.py migrate
$ docker-compose run --rm django python manage.py reimbursements /mnt/data/reimbursements_sample.xz
$ docker-compose run --rm django python manage.py companies /mnt/data/companies_sample.xz
$ docker-compose run --rm django python manage.py suspicions /mnt/data/suspicions_sample.xz
$ docker-compose run --rm django python manage.py tweets
$ docker-compose run --rm django python manage.py searchvector
I guess I did something wrong, since I didn't get it:
How do I:
Edit
docker-compose.yml
to useDockerfile-elm
file instead of pullingdatasciencebr/jarbas-frontend
.
?
I guess I did something wrong here
While running, I got this error:
How do I:
Edit
docker-compose.yml
to useDockerfile-elm
file instead of pullingdatasciencebr/jarbas-frontend
.
Comment out the image from docker-compose to build django and tasks containers locally:
# image: datasciencebr/jarbas-backend build: context: .
This time commenting out jarbas-frontend
not jarbas-backend
.
The error you shared seems totally unrelated to the Elm container (twitter.error.TwitterError
). Do you have the logs from the Elm container (the output of $ docker-compose logs elm
)?
I'll attach the result of Elm log, and the migrations:
I'll attach the result of Elm log
From this output I'm afraid you're running something else in the elm
container. The output looks like Django's one. Can you share your docker-compose.yml
?
Sure:
docker-compose.yml
:
elm:
build: .
Hum…got it! These lines makes elm
container user the default Dockerfile
(which is a Django container), not Dockerfile-elm
.
elm:
build:
context: Dockerfile-elm
That should work.
I've did the changes, still not work:
My bad. Checking Docker Compose docs, the correct would be:
elm:
build:
context: .
dockerfile: Dockerfile-elm
Ok, let's continue ;)
YAS! It is working now \o\
Tried to search something, and works fine \o\
What is the purpose of this Pull Request?
The Docker image to render Elm was too big (723MB):
What was done to achieve this purpose?
I suggest we use the
slim
version of thenode
Docker image instead (I triedalpine
but ended up with somenpm
errors). This reduced the image size in 61%:How to test if it really works?
Edit
docker-compose.yml
to useDockerfile-elm
file instead of pullingdatasciencebr/jarbas-frontend
. Build containers, run Jarbas and check if Layers (localhost:8000/layers/
) doesn't crash.Who can help reviewing it?
@anaschwendler