-
Notifications
You must be signed in to change notification settings - Fork 61
Conversation
Changes Unknown when pulling ba55e58 on lipemorais:master into ** on datasciencebr:master**. |
I really liked that:
Not because I'm kind of against Docker on production, but because… baby steps and focus! But there's also something I don't like: But so far so good ; ) Some questions:
|
I am not a Windows user for a long time. Do you have any tip how could be it Windows friendly?
Both questions are related. There were a chain of problems in Dockerfile-elm. To isolate the problem I built Dockerfile-elm alone using
what I think that is not elegant, so I investigate a little more and found a second solution to install yarn using npm instead of apt-get that looks good enough, so I used it. This is the error that I found:
After this tree step I achieved this PR. |
Wow… thank you so much for the explanation! So far so good ; ) |
Me neither (since 2002 BTW) but I wrapping commands in a docker-compose up -d --build
docker-compose run --rm jarbas python manage.py ceapdatasets
docker-compose run --rm jarbas python manage.py migrate
docker-compose run --rm jarbas python manage.py collectstatic --no-input We can keep the |
I will take a look at this others PRs and see how I can use them to improve this one. Does it worked for anyone? @cuducos @anaschwendler @jtemporal @Irio ? |
I haven't tested it throughly (I mean, clean |
Changes Unknown when pulling 15ab50e on lipemorais:master into ** on datasciencebr:master**. |
I added one more change reusing the shared volume between the containers assets to make rest_framework assets available through NGINX. Fixing the first point of the TODO list. If more explanation is needed to understand which was my approach to solve this issue please, just let me know. |
…ocker image builds
Changes Unknown when pulling 63529dd on lipemorais:master into ** on datasciencebr:master**. |
…omated docker image builds" This reverts commit 63529dd.
Changes Unknown when pulling ed7a711 on lipemorais:master into ** on datasciencebr:master**. |
… of docker-compose will set the right configurarions
Changes Unknown when pulling 40a939a on lipemorais:master into ** on datasciencebr:master**. |
…more since environment variables are now given through docker-compose or sytem environment variables
Changes Unknown when pulling 3b73256 on lipemorais:master into ** on datasciencebr:master**. |
…g this elm container
Changes Unknown when pulling fd09172 on lipemorais:master into ** on datasciencebr:master**. |
I made a test to solve the TODO list points 2 and 3, about use images and not build it every time. To do this I made 3 docker images for Jarbas, Frontend and NGINX that were the images constructed after run docker-compose. If you want to take a look: The next step is have this 3 images in Data Science Brigade Docker Hub: https://hub.docker.com/u/datasciencebr/ A second point in this PR is move .env from jarbas dockerfile to docker-compose so the environment variables can be passed through docker-compose make the application adapt itself at each environments(development, production, ...). |
I'm getting |
But I do not have any lead of whitenoise in my fork.
I can merge it, of course. How can I apply this changes? |
Wow… so I might have messed up the branches here. Never mind. Do you want access to our DockerHub or would you like to help me setting this up? |
If prefer the second option of empower you, so more than people than me hold this knowledge. Sounds good to you @cuducos ? |
Hell yeah 🤘 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some inline comments. Hope they're helpful. Besides them se might delete staticfiles
volume (lines 67-68) that seems unused…
@@ -3,7 +3,6 @@ COPY requirements.txt /requirements.txt | |||
RUN python -m pip install -U pip | |||
RUN python -m pip install -r requirements.txt | |||
RUN apt-get update && apt-get install -y postgresql postgresql-contrib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory we were installing PostgreSQL because pyscopg2
(PostgreSQL driver for Python) needs one or other library that comes with PostgreSQL. If this apt-get
is coming after pip
this might not be necessary anymore.
TLDR IMHO we can get rid of line 5
- "./:/code" | ||
- ".env:/code/.env" | ||
environment: | ||
- SECRET_KEY=lets-rock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's extremely unsafe to use this for production. As the focus is development environment this is not a problem right now… but I decided to let this note here so we can (later) take care of that and of GOOGLE_STREET_VIEW_API_KEY
; )
Hi @lipemorais ! |
@@ -1,5 +1,5 @@ | |||
run.jarbas: | |||
docker-compose up -d --build | |||
docker-compose up -d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must reflect this change in README.md
before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed: 8b73b79
Changes Unknown when pulling 8b73b79 on lipemorais:master into ** on datasciencebr:master**. |
I tested it more today. It works beautifully for development — hell yeah, many many thanks, @lipemorais! Before merging we would like to see some bugs and issues squashed:
Is this feasible? |
It's completely feasible. I will work on the next points soon. |
Changes Unknown when pulling f60ea8e on lipemorais:master into ** on datasciencebr:master**. |
…add the instructions in README
Changes Unknown when pulling 1cdab6d on lipemorais:master into ** on datasciencebr:master**. |
Theoretically is just export GOOGLE_STREET_VIEW_API_KEY=your-google-api-key, so docker compose will get it from envvar with the same name. As I do not have a Api Key I'm just base in docker-compose documentation in: https://docs.docker.com/compose/environment-variables/#passing-environment-variables-through-to-containers @cuducos, when you have break could you try it? |
Changes Unknown when pulling f2a6f31 on lipemorais:master into ** on datasciencebr:master**. |
About the second point it's not a big change since the file is inside the project folder, everything works very similar. I added some a instruction in README.md just to make it clearer and more explicit. I also exposed the port 5432 of db container to make possible connect in the database using a postgres client. |
Changes Unknown when pulling f2a6f31 on lipemorais:master into ** on datasciencebr:master**. |
Sweet! Many many thanks for all that, @lipemorais! |
I loved the PR! Thanks @lipemorais |
This is in progress, I just created it earlier to have earlier feedbacks.
What is the purpose of this Pull Request?
The purpose of this PR is make easier contribute and develop for Jarbas using docker-compose and docker.
What was done to achieve this purpose?
Initially I fixed elm dockerfile to make docker work again for development with Jarbas. I have below a list of things to be done to make it ideal.
How to test if it really works?
make run.devel
Who can help reviewing it?
@gomex @Irio @anaschwendler @jtemporal @cuducos
What is out of scope
Is out of scope make this docker-compose ready for production environment, I'm planing to work on it in a next PR.
TODO