Database must be configured to use UTC timeformat (for auto filled values like createdAt)! All Dates stored are in UTC timeformat.
Native packages must be added to /apps/expo and /apps/next. Only adding to /packages/app is not possible as android builds do not find them there.
To build a docker image, run in repo root
docker-compose build .This command builds a docker image that is optimized for ARM64 (as this is the operating architecture of our hosting server). The image includes a nodejs next server that serves the API endpoint and the web app. Also, the image includes an executable migrate.js that applies migration files to the host database.
To run a built image, execute
docker run -p 3000:3000 ghcr.io/nwebrde/checkokayTo deploy a built docker image to our hosting dokku server, run
docker image save ghcr.io/nwebrde/checkokay:latest | ssh -i /Users/niklasweber/.ssh/dokku.key ubuntu@dokku-ssh.nweber.de dokku git:load-image checkokay ghcr.io/nwebrde/checkokay:latestTo upload to ghcr, run
echo $CR_PAT | docker login ghcr.io -u nikwebr --password-stdin
docker push ghcr.io/nwebrde/checkokay:latestChanges to the database scheme must be committed by running
cd packages/db
yarn migrations:generatePlease ensure that the generated mitigation file is added to git!
This command generates migration files. These migrations can then be applied to the local database by running
cd packages/db
yarn migrations:push-localHost database migrations are applied automatically on push, they can be executed manually by running
dokku run checkokay /bin/sh -c 'cd packages/db; node dist/migrate.js'The built docker image does not contain any environment variables. The docker image must be started with the environment variables needed for next (see step 8 of Setup Dokku Server and App)
The env variables inside /apps/next must be adopted. The database connection can be configured by either providing DATABASE_HOST, DATABASE, DATABASE_USER, and DATABASE_PASSWORD or by simply providing DATABASE_URL. The DATABASE_URL env variable is provided automatically by dokku on linkage of mysql service with the app.
The env variables inside /apps/expo must be adopted
Builds and pushes every git push to dokku and ghcr.io. Runs the database migration on the dokku server.
Important!: App must already be deployed to dokku. This GitHub Action only pushes changes to dokku app (see Setup Dokku Server and App, step 9)
- Install Dokku by following https://dokku.com/docs~v0.8.2/getting-started/installation/#1-install-dokku
- Setup cloudflare tunnel
- Add a new dokku app with
dokku apps:create checkokay- Add a mysql database service with
dokku mysql:create checkokay-db- Link database service with app
dokku mysql:link checkokay-db checkokay- Like mysql, add and link a redis service
- Add domain checkokay.com to app
dokku domains:add checkokay checkokay.com- Add port mapping
dokku ports:add checkokay http:80:3000- Add env variables: Copy the content of apps/next/.env.production and paste it in this command:
dokku config:set checkokay CONTENT- Deploy first version of app manually (important! Github Actions only pushes changes)
dokku git:from-image checkokay ghcr.io/nwebrde/checkokay:latest- Setup env Variables in GitHub to enable GitHub Actions to push changes to dokku server
EAS_LOCAL_BUILD_SKIP_CLEANUP=1 eas build --profile development --platform ios --localiOS Build fails while Archiving with log entry Provisioning profile "*[expo] XXX AdHoc XXX" doesn't include signing certificate "Apple Distribution: XXX"
"In keychain access, under Login, my certificates, delete all "Apple Distribution: ......" Certificates, then no need to download / do anything else, it just works", taken from expo/eas-cli#1201
APPLE_CLIENT_SECRET ist nur 180 Tage gültig und muss danach erneuert werden:
npx auth add apple
client id: de.nweber.checkokay.web
key id: DLFA4AWH5W
key location: /Users/niklasweber/dev/CheckOkay/apps/next/server/lib/AuthKey_DLFA4AWH5W.p8
team id: LZH6XCD46XYes, this repo was initially forked from a solito monorepo starter.