From 18cf148bd176d06d760555542bd8784eab5a36d9 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 17 May 2020 18:12:48 -0700 Subject: [PATCH] chore: Improve performance in dev by running Node/Yarn outside of docker (#1271) * Improve performance in dev by running Node/Yarn outside of docker * Transpose exposed port numbers by 100, so less likely conflict with host processes --- .env.sample | 6 +++--- Makefile | 5 +++-- README.md | 7 +++++-- docker-compose.yml | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.env.sample b/.env.sample index db590e04..badbb5f2 100644 --- a/.env.sample +++ b/.env.sample @@ -6,9 +6,9 @@ SECRET_KEY=generate_a_new_key UTILS_SECRET=generate_a_new_key -DATABASE_URL=postgres://user:pass@postgres:5432/outline -DATABASE_URL_TEST=postgres://user:pass@postgres:5432/outline-test -REDIS_URL=redis://redis:6379 +DATABASE_URL=postgres://user:pass@localhost:5532/outline +DATABASE_URL_TEST=postgres://user:pass@localhost:5532/outline-test +REDIS_URL=redis://localhost:6479 URL=http://localhost:3000 PORT=3000 diff --git a/Makefile b/Makefile index c770854a..a52cbca9 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ up: docker-compose up -d redis postgres s3 - docker-compose run --rm outline /bin/sh -c "yarn && yarn sequelize db:migrate" - docker-compose up outline + yarn install --pure-lockfile + yarn sequelize db:migrate + yarn dev build: docker-compose build --pull outline diff --git a/README.md b/README.md index 65418343..e9d012a4 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,11 @@ Outline requires the following dependencies: In development you can quickly get an environment running using Docker by following these steps: +1. Install these dependencies if you don't already have them + 1. [Docker for Desktop](https://www.docker.com) + 1. [Node.js](https://nodejs.org/) (v12 LTS preferred) + 1. [Yarn](https://yarnpkg.com) 1. Clone this repo -1. Install [Docker for Desktop](https://www.docker.com) if you don't already have it 1. Register a Slack app at https://api.slack.com/apps 1. Copy the file `.env.sample` to `.env` 1. Fill out the following fields: @@ -53,7 +56,7 @@ For a self-hosted production installation there is more flexibility, but these a 1. Clone this repo and install dependencies with `yarn` or `npm install` - > Requires [Node.js, npm](https://nodejs.org/) and [yarn](https://yarnpkg.com) installed + > Requires [Node.js](https://nodejs.org/) and [yarn](https://yarnpkg.com) installed 1. Build the web app with `yarn build:webpack` or `npm run build:webpack` 1. Using the `.env.sample` as a reference, set the required variables in your production environment. The following are required as a minimum: diff --git a/docker-compose.yml b/docker-compose.yml index d8171adc..5e199240 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,11 +3,11 @@ services: redis: image: redis ports: - - "6380:6379" + - "6479:6379" postgres: image: postgres ports: - - "5434:5432" + - "5532:5432" environment: POSTGRES_USER: user POSTGRES_PASSWORD: pass