diff --git a/Dockerfile b/Dockerfile index 1393d02..76e6def 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..125db88 --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/bin/sh +echo "Running database migrations..." +npx medusa db:migrate +echo "Starting Medusa server..." +npx medusa start