File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,15 @@ RUN pip install --no-cache-dir -r requirements.txt
1616# Copy application code
1717COPY . .
1818
19+ # Make entrypoint executable
20+ RUN chmod +x entrypoint.sh
21+
1922# Create non-root user
2023RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
2124USER appuser
2225
2326# Expose port (Railway uses dynamic PORT)
2427EXPOSE 8000
2528
26- # Default command (Railway overrides via railway.toml )
27- CMD ["sh" , "-c" , "uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-8000} " ]
29+ # Run entrypoint script (migrations, seed, then server )
30+ CMD ["./entrypoint.sh " ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ echo " Running database migrations..."
5+ alembic upgrade head
6+
7+ echo " Seeding database..."
8+ python scripts/seed_data.py || echo " Seed already exists or failed (continuing...)"
9+
10+ echo " Starting server..."
11+ exec uvicorn app.main:app --host 0.0.0.0 --port ${PORT:- 8000}
You can’t perform that action at this time.
0 commit comments