💚 Build docker images for postgresql only
Still need to find a way to change the database provider at runtime. For now let's just only enable postgresql for docker deployments Closes #324
This commit is contained in:
2
.github/workflows/publish_docker_images.yml
vendored
2
.github/workflows/publish_docker_images.yml
vendored
@ -10,6 +10,8 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
env:
|
||||||
|
DATABASE_URL: 'postgresql://'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
app: ['builder', 'viewer']
|
app: ['builder', 'viewer']
|
||||||
|
@ -7,3 +7,7 @@ To do so, follow these instructions:
|
|||||||
1. Copy `packages/db/.env.example` to `packages/db/.env` and replace `DATABASE_URL` with a development branch
|
1. Copy `packages/db/.env.example` to `packages/db/.env` and replace `DATABASE_URL` with a development branch
|
||||||
2. From the `packages/db` directory, run a the db push command: `pnpm run db:push`
|
2. From the `packages/db` directory, run a the db push command: `pnpm run db:push`
|
||||||
3. Then, in Planetscale dashboard, or using their CLI, you can create a new deploy request from this development branch to your production branch.
|
3. Then, in Planetscale dashboard, or using their CLI, you can create a new deploy request from this development branch to your production branch.
|
||||||
|
|
||||||
|
:::note
|
||||||
|
You can't connect to Planetscale database if you are deploying with Docker as docker images are currently built only with postgresql support.
|
||||||
|
:::
|
||||||
|
@ -2,18 +2,12 @@
|
|||||||
|
|
||||||
ENVSH_ENV=./apps/builder/.env.production ENVSH_OUTPUT=./apps/builder/public/__env.js bash env.sh
|
ENVSH_ENV=./apps/builder/.env.production ENVSH_OUTPUT=./apps/builder/public/__env.js bash env.sh
|
||||||
|
|
||||||
if [[ $DATABASE_URL == postgresql://* ]]; then
|
./node_modules/.bin/prisma generate --schema=packages/db/postgresql/schema.prisma;
|
||||||
./node_modules/.bin/prisma generate --schema=packages/db/postgresql/schema.prisma;
|
|
||||||
else
|
|
||||||
./node_modules/.bin/prisma generate --schema=packages/db/mysql/schema.prisma;
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 'Waiting 5s for db to be ready...';
|
echo 'Waiting 5s for db to be ready...';
|
||||||
sleep 5;
|
sleep 5;
|
||||||
|
|
||||||
if [[ $DATABASE_URL == postgresql://* ]]; then
|
./node_modules/.bin/prisma migrate deploy --schema=packages/db/postgresql/schema.prisma;
|
||||||
./node_modules/.bin/prisma migrate deploy --schema=packages/db/postgresql/schema.prisma;
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
node apps/builder/server.js;
|
node apps/builder/server.js;
|
@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
ENVSH_ENV=./apps/viewer/.env.production ENVSH_OUTPUT=./apps/viewer/public/__env.js bash env.sh
|
ENVSH_ENV=./apps/viewer/.env.production ENVSH_OUTPUT=./apps/viewer/public/__env.js bash env.sh
|
||||||
|
|
||||||
if [[ $DATABASE_URL == postgresql://* ]]; then
|
./node_modules/.bin/prisma generate --schema=packages/db/postgresql/schema.prisma;
|
||||||
./node_modules/.bin/prisma generate --schema=packages/db/postgresql/schema.prisma;
|
|
||||||
else
|
|
||||||
./node_modules/.bin/prisma generate --schema=packages/db/mysql/schema.prisma;
|
|
||||||
fi
|
|
||||||
|
|
||||||
node apps/viewer/server.js;
|
node apps/viewer/server.js;
|
Reference in New Issue
Block a user