Ver código fonte

chore: docker multiarch (#417)

Shuyoou 1 ano atrás
pai
commit
79499968d2
1 arquivos alterados com 6 adições e 2 exclusões
  1. 6 2
      Dockerfile

+ 6 - 2
Dockerfile

@@ -1,8 +1,12 @@
 # => Building container
-FROM node:18-slim as builder
+FROM --platform=$BUILDPLATFORM node:18-slim as builder
 WORKDIR /app
 COPY . .
 
+ARG TARGETPLATFORM
+ARG BUILDPLATFORM
+RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
+
 # => Building Client
 WORKDIR /app/client
 RUN yarn install
@@ -15,7 +19,7 @@ ENV PORT 80
 RUN yarn build
 
 # => Copy to Final container
-FROM node:18-slim
+FROM --platform=$BUILDPLATFORM node:18-slim
 WORKDIR /app
 COPY --from=builder /app/server/dist /app/dist
 COPY --from=builder /app/client/build /app/build