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

Dockerizing Caseflow App for demo and development #7368

Merged
merged 28 commits into from
Nov 9, 2018
Merged

Conversation

enriquemanuel
Copy link
Contributor

@enriquemanuel enriquemanuel commented Oct 11, 2018

Build Caseflow Docker Image

  1. Download this branch for the time being
  2. Navigate into the docker-bin folder and execute the build.sh
  3. This will download the dependencies, create the folders and start the docker build from the parent directory. Afterward, it will clean the dependencies from your computer

Start it up

  1. Go to the root of the project
  2. Execute docker-compose up -f docker-compose-demo.yml and it will create the databases, the cache and start everything up. Finally, it will seed the database and migrate it
  3. Finally, after a few minutes you will see the following lines:
appeals-app               | Starting Caseflow App RoR
appeals-app               | => Booting Puma
appeals-app               | => Rails 5.1.6 application starting in development
appeals-app               | => Run `rails server -h` for more startup options

This means the app has now started and you can navigate to localhost:3000 in your browser to use Caseflow

Troubleshooting

If you had run caseflow in your computer before, you might need to clean docker stuff.
For it, do the following:

  1. docker-compose down this will stop all the services that might have been enabled
  2. docker volume rm $(docker volume ls -q) this will delete all the volumes that you had. IMPORTANT if you had volumes that you care, don't execute this command, but do it with more cautious deleting the ones that you know are related to the docker-compose
  3. Run docker ps -a and check if you have anything dangling and remove it accordingly

@pkarman
Copy link
Contributor

pkarman commented Oct 11, 2018

@enriquemanuel I like where you're headed with this.

Might this help? https://store.docker.com/images/oracle-instant-client?tab=description

@enriquemanuel
Copy link
Contributor Author

The circleci issue might be due to the changes that I did to the yml files so connectivity might be not good since this now depends on the docker-compose file

docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
@enriquemanuel
Copy link
Contributor Author

I have created the separate compose file and updated the documentation above.
Also have reverted the changes back to the docker-compose.yml

Copy link
Contributor

@mdbenjam mdbenjam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌲 good work pushing through the difficulties on this!

Copy link
Contributor

@robalexdev robalexdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

docker-compose-demo.yml Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@lisac-usds
Copy link
Contributor

Whoa!! This looks really cool. Running through the build/startup this morning, will report back.

@ghost ghost assigned lisac-usds Nov 2, 2018
@lisac-usds
Copy link
Contributor

lisac-usds commented Nov 2, 2018

Ran the Build Caseflow Docker Image steps locally, verified git status showed no artifacts that needed to be committed.

@enriquemanuel some comments re: the s3 and ecr usage:

  1. Is it true, aws credentials need to be available as shell variables in order to run these commands? If so: could consider reminding the user of this, maybe via a comment in the script, as part of an error msg, or in a docker-bin/README.md?
  2. Are these s3/ecr resources accessible only to the Appeals Modernization team? If so: could consider flagging this (I noticed this repo is public, so hard to pin down who might try to run the script)

Still working through the Start it up steps (getting a strange error, probably just my local setup - a "pull access denied for store/oracle/database-enterprise...", will investigate this afternoon).

@anyakhvost
Copy link

Just an FYI, you pass -f option before up:

docker-compose -f docker-compose.yml up

@lisac-usds
Copy link
Contributor

Oops. To explain the issue I noted at the end of my previous message - I hadn’t signed up for store/oracle/database-enterprise, which led to my problem with running the vacols Dockerfile 🤦‍♀️ Solved by signing up for Oracle Database Enterprise Edition.

$ docker ps -a
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS                    PORTS                                                      NAMES
f6f4e7e15d69        caseflow:latest         "/bin/bash /caseflow…"   31 minutes ago      Up 31 minutes             0.0.0.0:3000->3000/tcp                                     appeals-app
6e1ee73fa0e2        redis:2.8.23            "docker-entrypoint.s…"   31 minutes ago      Up 31 minutes             0.0.0.0:6379->6379/tcp                                     appeals-redis
4531dda26a07        postgres:9.3.14         "/docker-entrypoint.…"   31 minutes ago      Up 31 minutes             0.0.0.0:5432->5432/tcp                                     appeals-db
f487aeafaab5        vacols_db               "bash -c /home/oracl…"   31 minutes ago      Up 31 minutes (healthy)   5500/tcp, 0.0.0.0:1522->1521/tcp                           VACOLS_DB-development
9d55d3a3643d        localstack/localstack   "/usr/bin/supervisor…"   31 minutes ago      Up 31 minutes             0.0.0.0:4567-4583->4567-4583/tcp, 0.0.0.0:8082->8080/tcp   localstack

You figured out how to dockerize Caseflow, @enriquemanuel!

Looks good to me. I left some comments about the aws/ecr access.

Copy link

@anyakhvost anyakhvost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I chatted with Enrique that we need a way to use a debugger and I've also noticed file changes are not picked up.

@enriquemanuel enriquemanuel merged commit 9b8fde2 into master Nov 9, 2018
@ghost ghost removed the In-Progress label Nov 9, 2018
@enriquemanuel enriquemanuel deleted the dockerizing branch November 9, 2018 20:22
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.

7 participants