From 6bb32c253b2680168386d163f8c580cd46e5f649 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 27 Sep 2020 10:32:08 -0700 Subject: [PATCH] fix: Unable to run migrations in latest image. Added option to run non-SSL migration in production --- Dockerfile | 1 - README.md | 3 ++- server/config/database.json | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 334173a4..f64cc622 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,6 @@ COPY . . RUN yarn build && \ yarn --production --ignore-scripts --prefer-offline && \ - rm -rf server && \ rm -rf shared && \ rm -rf app diff --git a/README.md b/README.md index df4f7977..bae6a206 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,8 @@ For a manual self-hosted production installation these are the suggested steps: 1. `REDIS_URL` (run your own local copy of Redis, or use a cloud service) 1. `URL` (the public facing URL of your installation) 1. `AWS_` (all of the keys beginning with AWS) -1. Migrate database schema with `yarn sequelize:migrate` +1. Migrate database schema with `yarn sequelize:migrate`. Production assumes an SSL connection, if +Postgres is on the same machine and is not SSL you can migrate with `yarn sequelize:migrate --env=production-ssl-disabled`. 1. Start the service with any daemon tools you prefer. Take PM2 for example, `NODE_ENV=production pm2 start ./build/server/index.js --name outline ` 1. Visit http://you_server_ip:3000 and you should be able to see Outline page diff --git a/server/config/database.json b/server/config/database.json index 8760c431..c9ad6e63 100644 --- a/server/config/database.json +++ b/server/config/database.json @@ -15,5 +15,9 @@ "rejectUnauthorized": false } } + }, + "production-ssl-disabled": { + "use_env_variable": "DATABASE_URL", + "dialect": "postgres" } } \ No newline at end of file