Change Dockerfile and start.sh to not skip devDependencies
This commit is contained in:
parent
bada2bd1f1
commit
0cd1a5e8d1
2 changed files with 11 additions and 4 deletions
13
Dockerfile
13
Dockerfile
|
|
@ -8,6 +8,7 @@ ARG DATABASE_URL
|
|||
ARG REDIS_URL
|
||||
ARG JWT_SECRET
|
||||
ARG COOKIE_SECRET
|
||||
ARG MEDUSA_BACKEND_URL
|
||||
|
||||
ENV STORE_CORS=$STORE_CORS
|
||||
ENV ADMIN_CORS=$ADMIN_CORS
|
||||
|
|
@ -16,7 +17,7 @@ ENV DATABASE_URL=$DATABASE_URL
|
|||
ENV REDIS_URL=$REDIS_URL
|
||||
ENV JWT_SECRET=$JWT_SECRET
|
||||
ENV COOKIE_SECRET=$COOKIE_SECRET
|
||||
ENV NODE_ENV=production
|
||||
ENV MEDUSA_BACKEND_URL=$MEDUSA_BACKEND_URL
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --legacy-peer-deps
|
||||
|
|
@ -24,8 +25,14 @@ COPY . .
|
|||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app .
|
||||
WORKDIR /app/server
|
||||
|
||||
COPY --from=builder /app/.medusa/server .
|
||||
RUN npm install --legacy-peer-deps
|
||||
|
||||
COPY start.sh .
|
||||
RUN chmod +x start.sh
|
||||
|
||||
ENV NODE_ENV=production
|
||||
EXPOSE 9000
|
||||
CMD ["sh", "start.sh"]
|
||||
|
|
|
|||
2
start.sh
2
start.sh
|
|
@ -2,4 +2,4 @@
|
|||
echo "Running database migrations..."
|
||||
npx medusa db:migrate
|
||||
echo "Starting Medusa server..."
|
||||
exec npx medusa start 2>&1
|
||||
npx medusa start
|
||||
|
|
|
|||
Loading…
Reference in a new issue