From 1fb1b4e08538e06599c2e83c76b3612d11a2b387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Kleppe-J=C3=B8rgensen?= Date: Wed, 17 Jun 2015 10:07:50 +0200 Subject: [PATCH] Make the app runnable with docker-compose --- docker-compose.yml | 13 +++++++++++++ package.json | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..27cc6f5063 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +web: + build: . + command: run db-migrate-and-start + ports: + - "4242:4242" + links: + - db + environment: + DATABASE_URL: postgres://postgres:unleash@db/postgres +db: + expose: + - "5432" + image: postgres:9.3 diff --git a/package.json b/package.json index deff3c9492..938831954e 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ }, "private": true, "scripts": { + "db-migrate-and-start": "npm run db-migrate && npm run start", "start": "NODE_ENV=production node server.js", "build": "./node_modules/.bin/webpack -p", "dev": "NODE_ENV=development supervisor --ignore ./node_modules/,./public/js server.js", @@ -26,6 +27,7 @@ "docker-test": "export PORT=4243 ; ./scripts/docker-postgres.sh", "pg-virtualenv-test": "pg_virtualenv npm run pg-virtualenv-chain", "pg-virtualenv-chain": "export TEST_DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; npm run db-migrate-testdb && npm test", + "db-migrate": "node_modules/.bin/db-migrate up", "db-migrate-testdb": "DATABASE_URL=$TEST_DATABASE_URL ./node_modules/.bin/db-migrate up", "tdd": "mocha --watch test test/*", "test-bamboo-ci": "mocha test test/*",