Coder Social home page Coder Social logo

rails-cdn-example's Introduction

Docker and you

This repo is focused on showing you how to setup a basic Rails application and configure Docker on top of it.

Setup

To get started, you'll need to have Rails installed locally on your machine. If you don't have Rails, you can download it by running bundle install rails in your terminal.

To get started with this particular project, you can run the following commands to get started:

  1. bundle
  2. rake db:create; rake db:migrate; rake db:seed
  3. rails s

Once you start your server, head over to localhost:3000/api/v1/users to see if anything populates from running your seed file.

Download Docker

You can find an easy way to download Docker right here

Once you are all set up, head over to your terminal and type in docker to see if Docker was installed correctly. You should see a large menu populate.

Important Docker Commands

There are some commands that you'll need to reuse over and over again. Some of the most important ones are the following:

  1. docker-compose build
  2. docker-compose up
  3. docker-compose down

Clean up after yourself

You'll also need to make sure you are cleaning up after yourself when playing around with images and containers. If you don't you may see some unwanted side effects and your code being stale. It's a good habit to run these commands if you forcefully quit your docker containers.

  1. docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
  2. docker rm $(docker ps -qa --no-trunc --filter "status=exited")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.