Run database migrations on startup
This commit is contained in:
parent
4ec3d91b5d
commit
41aff1c8bc
2 changed files with 7 additions and 1 deletions
|
|
@ -8,5 +8,6 @@ RUN npm run build
|
|||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app .
|
||||
RUN chmod +x start.sh
|
||||
EXPOSE 9000
|
||||
CMD ["npx", "medusa", "start"]
|
||||
CMD ["sh", "start.sh"]
|
||||
|
|
|
|||
5
start.sh
Normal file
5
start.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
echo "Running database migrations..."
|
||||
npx medusa db:migrate
|
||||
echo "Starting Medusa server..."
|
||||
npx medusa start
|
||||
Loading…
Reference in a new issue