-
Notifications
You must be signed in to change notification settings - Fork 6
[PROD RELEASE] - Updates & fixes #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
103c3bd
93e0da8
0ffaffb
0d99cea
b8ccdfa
663e1e8
6530304
611ee56
de2bc0d
d4aa9b4
127cce1
29ae9d7
972cb96
d464096
67d72d4
f5914e2
85ff0c7
bc505af
e41826c
87a1eb2
82232ba
c6d02f3
6c0e4d8
016a1b3
b829e34
cb14e83
38dd16c
cb285b3
c0ff57f
170cbc5
900e2da
9588596
7ed9d4b
0f5d076
0a4a03f
6a9bb43
c6c5463
38c74bd
8c73a69
d8c7eef
9a79208
7c61551
c1fb037
fcf4ede
81b85c5
30a34e2
ae34b10
e8fe599
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,10 @@ ENV PRISMA_LOG_LEVEL=info | |
|
|
||
| RUN mkdir -p /challenge-api/reports | ||
|
|
||
| RUN echo "Running database migrations..." | ||
| RUN npx prisma migrate deploy | ||
| # Copy entrypoint script and make it executable | ||
| COPY docker/entrypoint.sh /entrypoint.sh | ||
| RUN chmod +x /entrypoint.sh | ||
|
|
||
| CMD ["node","/challenge-api/app.js"] | ||
| # Use entrypoint to run migrations at startup (not build time) | ||
| # Prisma uses PostgreSQL advisory locks to prevent concurrent migrations | ||
| ENTRYPOINT ["/entrypoint.sh"] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| echo "Starting Challenge API v6..." | ||
|
|
||
| # Run database migrations | ||
| # Prisma uses PostgreSQL advisory locks to prevent concurrent migrations | ||
| # Only one instance will run migrations, others will wait | ||
| echo "Running database migrations..." | ||
| npx prisma migrate deploy | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
|
|
||
| # Check migration status | ||
| if [ $? -eq 0 ]; then | ||
| echo "Migrations completed successfully" | ||
| else | ||
| echo "Migration failed with exit code $?" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Start the application | ||
| echo "Starting application server..." | ||
| exec node /challenge-api/app.js | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[⚠️
security]Consider verifying the integrity of
entrypoint.shafter copying it into the image. This can help ensure that the script has not been tampered with and is safe to execute.