My project is using Docker Compose to create two services (app and postgres). Locally, app (Clojure application using Compojure, JDBC, Korma, Ragtime, etc.) connects to postgres immediately and without issue. However, when I deploy my application to a Digital Ocean Droplet (1 GB RAM/30 GB Disk/Ubuntu 16.04.2 x64) for testing purposes, app seemingly takes *minutes* to connect to postgres - e.g. Korma inserts hang for many minutes and then eventually start working without issue. The Droplet is smallish, but it doesn't seem to be starved for resources (based on output of htop).

Here are the relevant portions of my application:

```
;; project.clj
(defproject backend "0.1.0-SNAPSHOT"
  :min-lein-version "2.0.0"
  :dependencies [[com.grammarly/perseverance "0.1.2"]
                 [commons-codec/commons-codec "1.4"]
                 [compojure "1.4.0"]
                 [environ "1.0.3"]
                 [clj-http "2.3.0"]
                 [korma "0.4.3"]
                 [lock-key "1.4.1"]
                 [me.raynes/fs "1.4.6"]
                 [midje "1.6.3"]
                 [org.clojure/clojure "1.8.0"]
                 [org.clojure/core.async "0.3.441"]
                 [org.clojure/java.jdbc "0.7.0-alpha2"]
                 [postgresql "9.3-1102.jdbc41"]
                 [ragtime "0.6.0"]
                 [ring-cors "0.1.7"]
                 [ring-mock "0.1.5"]
                 [ring/ring-defaults "0.1.5"]
                 [ring/ring-json "0.4.0"]]
  :plugins [[lein-environ "1.0.3"]
            [lein-midje "3.1.3"]
            [lein-ring "0.9.7"]]
  :aliases {"migrate"  ["run" "-m" "backend.db/ragtime-migrate"]
            "rollback" ["run" "-m" "backend.db/ragtime-rollback"]}
  :ring {:handler backend.handler/app}
  :profiles
  {:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
                        [ring/ring-mock "0.3.0"]]}})

;; db.clj
(ns backend.db
  (:use [korma.core]
        [korma.db])
  (:require [clojure.string :as string]
            [environ.core :as environ]
            [lock-key.core :refer [encrypt-as-base64 decrypt-from-base64]
                           :rename {encrypt-as-base64 encrypt
                                    decrypt-from-base64 decrypt}]
            [ragtime.jdbc :as jdbc]
            [ragtime.repl :as repl]))

(def database-host (environ/env :postgres-port-5432-tcp-addr)) ;; set by Docker
(def database-name (environ/env :database-name))
(def database-password (environ/env :database-password))
(def database-port (environ/env :postgres-port-5432-tcp-port)) ;; set by Docker
(def database-sslmode (environ/env :database-sslmode))
(def database-user (environ/env :database-user))
(def database-url (str "jdbc:postgresql://"
                       database-host
                       ":"
                       database-port
                       "/"
                       database-name
                       "?user="
                       database-user
                       "&password="
                       database-password))

(defn load-config []
    {:datastore  (jdbc/sql-database {:connection-uri database-url})
     :migrations (jdbc/load-resources "migrations")})

(defn ragtime-migrate []
  (repl/migrate (load-config)))

(defn ragtime-rollback []
  (repl/rollback (load-config)))

(defdb db (postgres {:db database-name
                     :host database-host
                     :password database-password
                     :port database-port
                     :user database-user
                     :sslmode database-sslmode}))

(defentity engagements)

(def lock (environ/env :lock))

(defn query-engagement [id]
  (let [engagement (first
                     (select
                       engagements
                       (where {:id (read-string id)})))
        decrypted-email (->
                          (:email_address engagement)
                          (decrypt lock))]
    (conj engagement {:email_address decrypted-email})))

(defn create-engagement [email-address image-path]
  (let [encrypted-email (encrypt email-address lock)]
    (insert engagements
      (values [{:email_address encrypted-email
                :image_path image-path}]))))

;; docker-compose.yml
app:
  build: .
  volumes:
    - .:/app
  ports:
    - "127.0.0.1:3000:3000"
  links:
    - postgres
postgres:
  build: .
  dockerfile: Dockerfile-postgres
  expose:
    - "5432"

```

Am I doing something incorrectly? Might this be a JDBC connection pool issue? Is there a convention for debugging this sort of issue?

UPDATE: I can confirm that the problem persists if I run the application directly on the Digital Ocean Droplet, as opposed to via Docker.