***
IMPORTANT:
we need the edgedb-cli to connect to our dokku-edgeb plugin container to run the migrations that are in our dokku application container. The Dockerfile adds these.
***
Now create a Procfile in the root of your application:
release: edgedb migration apply
# Add a domain to the application and a subdomain for the EdgeDB admin ui.
1. dokku domains:add <myapp> <mydomain.com>
2. dokku domains:add <ui.myapp> <mydomain.com> where ui is the subdomain you will be accessing your edgeDB admin ui from.
## Enable the admin UI with the new plugin command
To easily inspect our edgedb database and its data for debugging and testing purposes we enable the admin ui ( after succesfull deploy ) the steps to do this is:
1. run the command add here
3. add a subdomain DNS to your mydomain.ltd
4. other steps
Deploying an Application on Dokku with Dokku-EdgeDB Plugin
Server Installation
Install Dokku.
Install the Dokku-EdgeDB plugin:
Create a Dokku-EdgeDB instance:
dokku edgedb:create lollipop
Link the Dokku-EdgeDB instance to your Dokku application:
dokku edgedb:link lollipop mydokkuapp
Deploying an Application on Local Dev to Dokku VPS Using Dokku-EdgeDB
RUN npm install -g npm@latest
Install all node_modules, including dev dependencies.
FROM base as deps
WORKDIR /app ADD package.json package-lock.json .npmrc ./ RUN npm install
Setup production node_modules.
FROM base as production-deps
WORKDIR /app RUN rm -rf /app/node_modules /app/node_modules COPY --from=deps /app/node_modules /app/node_modules ADD package.json package-lock.json .npmrc ./ RUN npm prune --production
Build the app
FROM base as build
WORKDIR /app
COPY --from=deps /app/node_modules /app/node_modules
Run the typescript generators
ADD . ./ RUN npm run build
Production build
FROM edgedb/edgedb as downloader FROM base COPY --from=downloader /usr/bin/edgedb /usr/bin/edgedb
WORKDIR /app COPY --from=production-deps /app/node_modules /app/node_modules COPY --from=build /app/build /app/build COPY --from=build /app/public /app/public COPY --from=build /app/dbschema/migrations /app/dbschema/migrations COPY --from=build /app/start.sh /app/start.sh ADD . ./
release: edgedb migration apply