Skip to content

A front-end stack for Docker-based projects at Upstatement

License

Notifications You must be signed in to change notification settings

Upstatement/ups-dock

Repository files navigation

Ups Dock

Streamline your local development workflow with Docker.

At Upstatement we're technology agnostic. We love tooling that enables us to build in any tech stack with minimal fuss, and shortens the feedback loop between changing things and seeing the results. Docker allows us to quickly spin up local development environments with any tech stack and build in a production-like environment, simulatenously solving the "works on my machine" problem, avoiding conflicting dependencies between projects, and keeping our local machines clean.

Ups Dock is our solution to some common pain points we encountered working with Docker, namely automating DNS resolution and SSL certificate management across projects.

Table of Contents

What's in the Box

Ups Dock provides a number of tools designed to streamline the process of spinning up and switching between projects.

  • Dashboard. Visit https://ups.dock to view all of your Ups Dock-compatible Docker projects.
  • Proxy. An nginx instance configured to proxy requests to connected containers. Based on nginx-proxy.
  • DNS. A custom DNS server to resolve all *.ups.dock host names to the nginx proxy, powered by dnsmasq.
  • SSL. A shared, self-signed wildcard certificate for use with *.ups.dock domains.
  • Email. A fake mail server to intercept e-mails while in development, powered by Mailhog.

System Requirements

  • Mac OS Sierra 10.12 and newer
  • Docker Desktop
  • Administrator privileges (the install script requires sudo to modify a few system settings related to DNS resolution and trusting SSL certificates).

Installation

  1. Clone this repository

    git clone [email protected]:Upstatement/ups-dock.git && cd ups-dock
  2. Run the install script

    ./bin/install.sh
  3. Visit the dashboard to view all of your ups.dock sites

    open https://ups.dock

Getting Started

We've curated a collection of Ups Dock-compatible starter kits for the most common stacks we're working with these days:

Making your project work with Ups Dock

Our starter kits not cutting it? Roll your own!

You can add Ups Dock support to your Docker Compose project with a few simple steps:

  1. Add the VIRTUAL_HOST and UPS_DOCK_NAME environment variables to your web service
  2. Add the ups-dock external network to your web service
  3. Configure your web services' application to use Mailhog (optional)

Here's a minimal docker-compose.yml example:

version: '3.5'
services:
  web:
    image: your-web-image
    environment:
      # Display name presented on http://ups.dock
      UPS_DOCK_NAME: Example Website
      # Host name you want to use. Must end in `ups.dock`.
      VIRTUAL_HOST: example.ups.dock
      # Allow http and https traffic (default will automatically redirect http -> https)
      HTTPS_METHOD: noredirect
      # Set this if your web service is running on a port other than 80
      # VIRTUAL_PORT: 8080
    networks:
      - proxy
      - default
networks:
  proxy:
    name: ups-dock
    external: true

You can route SMTP traffic to the mailhog host, port 1025 to catch outgoing email during development. Intercepted email is visible at https://mailhog.ups.dock.

Troubleshooting

Docker Desktop: Error invoking remote method docker-start-container - Mounts Denied

image

You should be able to resolve this by re-creating the Ups Dock containers with the following command:

docker-compose up -d

Contributing

We welcome all contributions to our projects! Filing bugs, feature requests, code changes, docs changes, or anything else you'd like to contribute are all more than welcome! More information about contributing can be found in the contributing guidelines

Code of Conduct

Upstatement strives to provide a welcoming, inclusive environment for all users. To hold ourselves accountable to that mission, we have a strictly-enforced code of conduct.

About Upstatement

Upstatement is a digital transformation studio headquartered in Boston, MA that imagines and builds exceptional digital experiences. Make sure to check out our services, work, and open positions!