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

Development Container (Docker) #134

Merged
merged 10 commits into from Aug 26, 2015
Merged

Development Container (Docker) #134

merged 10 commits into from Aug 26, 2015

Conversation

dhcole
Copy link
Contributor

@dhcole dhcole commented Aug 25, 2015

Packaging Federalist as a Docker container makes it for new team members and others interested in the project to quickly get started running the application locally.

Since Federalist ties together several frameworks and applications (node.js, Sails.js, ruby, Jekyll, localtunnel / ngrok) it can be challenging to get a local environment set up, and it's often unnecessary to do so when simply reviewing the application.

The PR makes a few changes to Federalist to make it ready for running in a container:

  • Override GitHub oauth if a "personal access token" is provided
  • Set up a localtunnel and set the webhook callback to it (when running in development)
  • Run jekyll with bundle exec to ensure dependencies are in scope

And this PR sets up a Dockerfile for building Federalist into a docker image. That image is published on the Docker Hub

Deploy Federalist from the Docker Hub:

  1. Download and install the Docker Toolbox
  2. Set up a GitHub personal access token
  3. Open Kitematic on your Mac (it's installed with the Docker Toolkit), search for "Federalist", and click create:
    screen shot 2015-08-25 at 4 54 22 pm
  4. Click "Settings", paste your personal access token next to GITHUB_TOKEN, and click "Save"
    screen shot 2015-08-25 at 4 55 00 pm
  5. Click "Home" and you'll see the log of Federalist starting up. (You may need to wait a minute for the application to start up.) Click the arrow next to "Web Preview" to open up Federalist in your browser:
    screen shot 2015-08-25 at 4 55 18 pm
  6. You're now running Federalist in a local container and you can do all the things you'd usually do with it
    screen shot 2015-08-25 at 4 55 57 pm
    screen shot 2015-08-25 at 4 56 06 pm
    screen shot 2015-08-25 at 4 56 09 pm
  7. Bonus: you can try our other branches of Federalist (useful for reviewing pull requests). Get the branch name from GitHub:
    screen shot 2015-08-25 at 4 56 49 pm
  8. Go back to "Settings" in Kitematic, set the BRANCH environment variable, and click "Save":
    screen shot 2015-08-25 at 4 56 57 pm
  9. Now on "Home", you'll see the log of the application checking out the branch and rebuilding. Give it a minute, then open the web preview:
    screen shot 2015-08-25 at 4 57 34 pm
  10. You now have the application running with the new branch.
    screen shot 2015-08-25 at 4 57 46 pm
    screen shot 2015-08-25 at 4 58 09 pm
    screen shot 2015-08-25 at 5 00 26 pm

@jeremiak
Copy link
Contributor

This is so cool! Very easy to install and get running 😄

I'm having an issue getting the most current master branch to display properly. I updated the branch setting to be master, waited for Docker to pull it down and build it, and then when I go to look at the preview it looks like the npm install tasks didn't get run because there is no style sheet:

Any ideas @dhcole?

@dhcole
Copy link
Contributor Author

dhcole commented Aug 26, 2015

@jeremiak did it work when you first loaded the container (with no branch)? I think this is because there is no dockerfile or docker-start.sh script in the remote master. It should be a temporary problem resolved by merging.

@jeremiak
Copy link
Contributor

Cool, sounds like a good theory. Merging now

jeremiak added a commit that referenced this pull request Aug 26, 2015
Development Container (Docker)
@jeremiak jeremiak merged commit fba8b4f into master Aug 26, 2015
@jeremiak jeremiak deleted the pull/docker-dev branch August 26, 2015 22:09
@afeld
Copy link
Contributor

afeld commented Jan 8, 2016

Awesome thorough instructions! Moved them to a wiki page for more visibility – hope that's ok!

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.

None yet

3 participants