fix: update Dockerfile to run database migrations in CMD#422
Open
kartikangiras wants to merge 2 commits intocameri:mainfrom
Open
fix: update Dockerfile to run database migrations in CMD#422kartikangiras wants to merge 2 commits intocameri:mainfrom
kartikangiras wants to merge 2 commits intocameri:mainfrom
Conversation
Contributor
Author
|
@cameri PTAL |
There was a problem hiding this comment.
Pull request overview
Updates the Railway-focused Dockerfile to avoid running database migrations during the image build (when Postgres isn’t available), and instead run migrations when the container starts.
Changes:
- Removed
npm run db:migratefrom the Docker build stage. - Updated the container
CMDto runnpm run db:migratebefore starting the Node server. - Minor Dockerfile syntax/style normalization (
AS build).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
@kartikangiras could you please address the conflicts and Copilot's review? |
92188bd to
eb66904
Compare
Contributor
Author
|
@cameri I have made the required changes , according to the review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the Railway deployment failure caused by running database migrations during the Docker build phase when the PostgreSQL service isn't available.
Related Issue
fixes #379
Motivation and Context
How Has This Been Tested?
docker build -f Dockerfile.railwayapp \ --build-arg PORT=8080 \ --build-arg PGHOST=localhost \ --build-arg PGPORT=5432 \ --build-arg PGDATABASE=nostream \ --build-arg PGUSER=postgres \ --build-arg PGPASSWORD=postgres \ -t nostream:test .Build completed successfully with no ECONNREFUSED errors
Screenshots (if appropriate):
Types of changes
Checklist: