Add Migrations
This commit is contained in:
@@ -42,8 +42,12 @@ COPY . .
|
||||
# Build TypeScript
|
||||
RUN npm run build
|
||||
|
||||
# Copy entrypoint script
|
||||
COPY docker-entrypoint.sh /app/
|
||||
RUN chmod +x /app/docker-entrypoint.sh
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
# Start application (migrations will be run via docker-compose command)
|
||||
CMD ["npm", "start"]
|
||||
# Start application with migrations
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
|
||||
8
backend/docker-entrypoint.sh
Normal file
8
backend/docker-entrypoint.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "Running database migrations..."
|
||||
npx prisma migrate deploy
|
||||
|
||||
echo "Starting application..."
|
||||
exec npm start
|
||||
Reference in New Issue
Block a user