Update workloads/commerce-backend/Dockerfile
Build and Push Medusa / Construir y publicar Medusa (push) Failing after 22m12s
Build and Push Medusa / Construir y publicar Medusa (push) Failing after 22m12s
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
###############################################
|
||||
# Builder
|
||||
###############################################
|
||||
FROM node:22.18.0-bookworm-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
@@ -15,8 +18,8 @@ ENV CI=true \
|
||||
JWT_SECRET=build-only-jwt-secret \
|
||||
COOKIE_SECRET=build-only-cookie-secret \
|
||||
S3_FILE_URL=http://localhost:9000/ari-shopping \
|
||||
S3_ACCESS_KEY_ID=build-only-access \
|
||||
S3_SECRET_ACCESS_KEY=build-only-secret \
|
||||
S3_ACCESS_KEY_ID=build-access-key \
|
||||
S3_SECRET_ACCESS_KEY=build-secret-key \
|
||||
S3_BUCKET=ari-shopping \
|
||||
S3_ENDPOINT=http://127.0.0.1:9000
|
||||
|
||||
@@ -29,12 +32,21 @@ RUN --mount=type=cache,id=medusa-builder-npm,target=/root/.npm,sharing=private \
|
||||
--no-audit \
|
||||
--no-fund
|
||||
|
||||
COPY tsconfig.json medusa-config.ts ./
|
||||
COPY tsconfig.json ./
|
||||
COPY medusa-config.ts ./
|
||||
COPY src ./src
|
||||
|
||||
RUN npm run build && \
|
||||
test -f /app/.medusa/server/medusa-config.js
|
||||
RUN test -d node_modules
|
||||
RUN test -f node_modules/@medusajs/cli/package.json
|
||||
|
||||
RUN npm run build
|
||||
|
||||
RUN test -f .medusa/server/package.json
|
||||
RUN test -f .medusa/server/medusa-config.js
|
||||
|
||||
###############################################
|
||||
# Runtime
|
||||
###############################################
|
||||
FROM node:22.18.0-bookworm-slim AS runtime
|
||||
|
||||
WORKDIR /app
|
||||
@@ -43,16 +55,11 @@ ENV NODE_ENV=production \
|
||||
PORT=9000 \
|
||||
NPM_CONFIG_UPDATE_NOTIFIER=false
|
||||
|
||||
COPY --from=builder /app/.medusa/server/package.json ./
|
||||
COPY .npmrc ./
|
||||
#
|
||||
# NO volver a ejecutar npm install
|
||||
#
|
||||
|
||||
RUN --mount=type=cache,id=medusa-runtime-npm,target=/root/.npm,sharing=private \
|
||||
npm install \
|
||||
--omit=dev \
|
||||
--legacy-peer-deps \
|
||||
--prefer-offline \
|
||||
--no-audit \
|
||||
--no-fund
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
|
||||
COPY --from=builder /app/.medusa/server ./
|
||||
|
||||
@@ -62,4 +69,4 @@ USER node
|
||||
|
||||
EXPOSE 9000
|
||||
|
||||
CMD ["npx", "medusa", "start"]
|
||||
CMD ["npx","medusa","start"]
|
||||
Reference in New Issue
Block a user