blog

ブログ

SoCal developer building with Ruby, JavaScript and Python.


good golly docker is great...

08 Dec 2025

For a long while, deploying my own projects to production was impossible. It was mysterious and a bit scary. Scary the same way that working with databases can be for new developers. We’ve all heard stories of someone accidentally dropping the database and losing all the data…


I developed cool apps locally but I didn’t know how to ship beyond my machine for others to enjoy. This led me to Github pages which lets you deploy static websites (that’s how I host heyheymikey!). But, Github pages is limited by this constraint. For example, you can’t ship an application that relies on a database.


Enter Docker!


This past term I took a class called Docker, DevOps and Deployments. In it, I learned all about how to Dockerize applications, create a platform as a service and deploy to production! I wrote this post to recap some of my favorite learnings from the course and try to squash any of the fear others might be having about deploying their personal projects to production!


First, what is Docker?


Docker is a tool that allows you to package everything needed to run your application into a little box, called a container. What’s needed to run your application you may be thinking? Well, first you need an operating system. Then, your application code. Also, potentially a database.


Docker helps you package up these services in a neat little terrarium-like environment so others can run your application too (“build and deploy anywhere”). Each container contains one service, they can talk to each other via orchestration (more on that later). Here’s an example Dockerfile that starts a Rails application:


FROM ruby:3.2

# Install dependencies

RUN apt-get update -qq && apt-get install -y nodejs postgresql-client

# Set working directory

WORKDIR /app

# Install gems

COPY Gemfile Gemfile.lock ./
RUN bundle install

# Copy application code

COPY . .

# Precompile assets

RUN bundle exec rake assets:precompile

# Expose port

EXPOSE 3000

# Start the server

CMD ["rails", "server", "-b", "0.0.0.0"]

Helpful Docker Commands:

  • docker build -t my-rails-app .
  • docker run -p 3000:3000 my-rails-app
  • docker ps
  • docker logs container-id
  • docker stop container-id

Notice how this starts one service? If you need to start multiple services (web server and database, for example) you need an orchestrator, such as Docker Compose. Think of Docker Compose as a conductor and each container a section in the orchestra. Docker Compose gets all the required services up-and-running, communicating with each other and following the conductor’s lead.


Here’s a Docker Compose file that orchestrates both a Rails app and a PostgreSQL database:

services:
  db:
    image: postgres:15
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: password
      POSTGRES_DB: myapp_production

  web:
    build: .
    command: bundle exec rails server -b 0.0.0.0
    volumes:
      - .:/app
    ports:
      - "3000:3000"
    depends_on:
      - db
    environment:
      DATABASE_URL: postgres://postgres:password@db:5432/myapp_production

volumes:
  postgres_data:

Helpful Docker Compose Commands:

  • docker-compose up
  • docker-compose up -d
  • docker-compose down
  • docker-compose logs -f
  • docker-compose exec web bash

So how does all this mitigate your fears of deploying personal projects to production? Well, remember I said that Docker includes everything you need to run an application?


If only there was a place where you could buy a remote server… then you could get that remote server to deploy the application for you!


Enter DigitalOcean and CapRover!


DigitalOcean is a cloud provider that lets you spin up virtual servers (called Droplets) for cheap. You get actual hardware in a data center that you can SSH into and control. Perfect for deploying your application to production!


Here’s where it gets even better: CapRover is a free, open-source platform that turns your DigitalOcean droplet into your own personal Heroku for hosting applications! It handles:

  • Automatic HTTPS certificates
  • Easy deployment from Git repos or Docker images
  • Built-in database installations (PostgreSQL, MongoDB, MySQL)
  • A web dashboard to manage everything
  • Automatic container updates with zero downtime

And the setup is surprisingly simple:

  1. Create a DigitalOcean droplet
  2. Install CapRover with a single command
  3. Connect your domain name
  4. Deploy your Dockerized app through the web UI or CLI

Suddenly, what seemed impossible becomes routine. You push your code, CapRover builds your Docker image, and your app is live on the internet. No more mystery. No more fear.


Looking back, the scary part about deployment wasn’t the technical complexity—it was not knowing where to start. Docker gives you a consistent way to package applications. Tools like CapRover remove the server management overhead. And cloud providers like DigitalOcean make servers accessible and affordable.


That database-driven app you built? It can be live for the cost of a couple coffees per month. Now go ship something!