boxfile.yml
run.config:
# set your engine like normal
engine: none
# define database desired in production
data.db:
image: nanobox/postgresql:9.5
# not necessary for launching database only, but add for `deploy dry-run`
web.thing:
start: sleep 1d
local_only: true
nanobox remote add <myapp>
nanobox deploy
Depending on your setup, you can run nanobox tunnel data.db
from your workstation and connect to it from within your local app.
Terminal 1
nanobox tunnel data.db
# listening on port 5432
Terminal 2
# Add database variables from dashboard
nanobox evar add local REMOTE_DB_NANOBOX_USER=nanobox,REMOTE_DB_NANOBOX_PASS=password
nanobox run
#...
# connect to your db
psql -h 192.168.99.1 -U nanobox -d gonano
# Password for user nanobox:
# psql (9.5.6)
# Type "help" for help.
#
# gonano=#
Alternatively, you can always download the linux version of the cli into your web container and tunnel
from within that nanobox run
and work in another terminal.
Note: This was tested on linux with docker-machine (virtualbox), ymmv