aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-image.sh3
-rw-r--r--scripts/build.env22
-rwxr-xr-xscripts/container-entrypoint.sh5
3 files changed, 26 insertions, 4 deletions
diff --git a/scripts/build-image.sh b/scripts/build-image.sh
index 95b8acb..c900089 100755
--- a/scripts/build-image.sh
+++ b/scripts/build-image.sh
@@ -5,9 +5,6 @@ SPLIIT_VERSION=$(node -p -e "require('./package.json').version")
# we need to set dummy data for POSTGRES env vars in order for build not to fail
docker buildx build \
- --no-cache \
- --build-arg POSTGRES_PRISMA_URL=postgresql://build:@db \
- --build-arg POSTGRES_URL_NON_POOLING=postgresql://build:@db \
-t ${SPLIIT_APP_NAME}:${SPLIIT_VERSION} \
-t ${SPLIIT_APP_NAME}:latest \
.
diff --git a/scripts/build.env b/scripts/build.env
new file mode 100644
index 0000000..98b3fac
--- /dev/null
+++ b/scripts/build.env
@@ -0,0 +1,22 @@
+# build file that contains all possible env vars with mocked values
+# as most of them are used at build time in order to have the production build to work properly
+
+# db
+POSTGRES_PASSWORD=1234
+
+# app
+POSTGRES_PRISMA_URL=postgresql://postgres:${POSTGRES_PASSWORD}@db
+POSTGRES_URL_NON_POOLING=postgresql://postgres:${POSTGRES_PASSWORD}@db
+
+# app-minio
+NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS=false
+S3_UPLOAD_KEY=AAAAAAAAAAAAAAAAAAAA
+S3_UPLOAD_SECRET=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+S3_UPLOAD_BUCKET=spliit
+S3_UPLOAD_REGION=eu-north-1
+S3_UPLOAD_ENDPOINT=s3://minio.example.com
+
+# app-openai
+NEXT_PUBLIC_ENABLE_RECEIPT_EXTRACT=false
+OPENAI_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXX
+NEXT_PUBLIC_ENABLE_CATEGORY_EXTRACT=false
diff --git a/scripts/container-entrypoint.sh b/scripts/container-entrypoint.sh
index 364787e..5871314 100755
--- a/scripts/container-entrypoint.sh
+++ b/scripts/container-entrypoint.sh
@@ -1,3 +1,6 @@
#!/bin/bash
-prisma migrate deploy
+
+set -euxo pipefail
+
+npx prisma migrate deploy
npm run start