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

Docker-compose #121

Merged
merged 5 commits into from
Mar 22, 2019
Merged

Docker-compose #121

merged 5 commits into from
Mar 22, 2019

Conversation

ohtake
Copy link
Contributor

@ohtake ohtake commented Nov 5, 2018

This PR will:

  • make docker-compose working again
  • install ffmpeg to support audio recording feature

@jakerenzella
Copy link
Member

@ohtake Looks like it just might be missing LaTeX distribution? Otherwise, this is a good base for adding the rest of the native dependencies, I will pull this down and run the tests.

@jakerenzella jakerenzella self-requested a review November 5, 2018 12:03
@ohtake
Copy link
Contributor Author

ohtake commented Nov 5, 2018

It installs TeX Live at line 32, but I have not tested the TeX feature.

@akashagarwal7
Copy link
Contributor

Did you try running this for dev environment which requires Postgres? AFAIK you need: libpq-dev https://pypi.org/project/libpq-dev/

@macite
Copy link
Member

macite commented Nov 6, 2018

Perhaps with this workflow we should look at dropping the separation between the two and just use MySQL in development and production.

@akashagarwal7
Copy link
Contributor

Sounds good to me :) That'd help with the emoji thingy as well.

@ohtake
Copy link
Contributor Author

ohtake commented Nov 6, 2018

libpq-dev has been moved from line 9 to line 20.
This change was not intended.
I will update the commit to minimize changes.

@ohtake
Copy link
Contributor Author

ohtake commented Nov 7, 2018

Two tests passed:

  • (ffmpeg) Submit audio comments and listen to them
  • (latex) Submit tasks and view the generated PDFs

Shall I separte MySQL in this PR?
Or it should be in another PR?

@jakerenzella
Copy link
Member

@ohtake Looks good so far, let's just keep it in this PR, we can merge when ready 👍

@ohtake
Copy link
Contributor Author

ohtake commented Nov 8, 2018

I had a talk with @jakerenzella about reloading the API without restarting a Docker container.
Excluding .bundle and tmp directories enables Dockerized rails app to reload itself.

Similar approach may be applied to the web project but it requires modifications on Grunt tasks.
Changes for the web are commented out for now.

- ffmpeg is available on newer versions of Ubuntu
- ffmpeg replaces libav-tools
- installs Ruby using rbenv because Ruby 2.3.1 is not provided by Ubuntu
- wget is required by texlive-install.sh
- libmysqlclient-dev is required to build gems
@ohtake
Copy link
Contributor Author

ohtake commented Nov 16, 2018

Finally, managed to dockerize the api and web with live-reloading feature.
Changes in source code will be automatically applied to Docker containers without restarting them.

Usage

export DF_DOCKER_MACHINE_IP=192.0.2.1 # Replace it for your own env
cd doubtfire-api
docker-compose build
docker-compose up -d
# wait a few seconds
docker-compose exec api bundle exec rake db:populate

Open http://localhost:8000/ for Angular 1 project ('development' branch in web) or http://localhost:4200/ for Angular 6 project ('quality/decafinate' branch in web).

Merging strategy

Because of dependencies and duplicated commits, it is better to merge PRs in the following order.

  1. Merge Support Docker on Windows doubtfire-web#129 into 'development'
  2. Merge 'development' into 'quality/decafinate'
  3. Rebase Dockerize (Angular 6 + 1) doubtfire-web#133 onto 'quality/decafinate'
  4. Merge Dockerize (Angular 6 + 1) doubtfire-web#133 into 'quality/decafinate'
  5. Merge this PR

@macite macite merged commit 7dc8d41 into doubtfire-lms:development Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants