|
@@ -7,13 +7,17 @@ ARG TARGETPLATFORM
|
|
ARG BUILDPLATFORM
|
|
ARG BUILDPLATFORM
|
|
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
|
|
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
|
|
|
|
|
|
|
|
+# Install git
|
|
|
|
+RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|
|
|
+
|
|
# => Building Client
|
|
# => Building Client
|
|
WORKDIR /app/client
|
|
WORKDIR /app/client
|
|
RUN yarn install --network-timeout 1000000
|
|
RUN yarn install --network-timeout 1000000
|
|
RUN yarn build
|
|
RUN yarn build
|
|
-# # => Building Server
|
|
|
|
|
|
+
|
|
|
|
+# => Building Server
|
|
WORKDIR /app/server
|
|
WORKDIR /app/server
|
|
-RUN yarn install --network-timeout 1000000
|
|
|
|
|
|
+RUN yarn install --network-timeout 1000000
|
|
ENV NODE_ENV production
|
|
ENV NODE_ENV production
|
|
ENV PORT 80
|
|
ENV PORT 80
|
|
RUN yarn build
|
|
RUN yarn build
|
|
@@ -23,20 +27,22 @@ FROM --platform=$TARGETPLATFORM node:22-slim
|
|
WORKDIR /app
|
|
WORKDIR /app
|
|
COPY --from=builder /app/server/dist /app/dist
|
|
COPY --from=builder /app/server/dist /app/dist
|
|
COPY --from=builder /app/client/build /app/build
|
|
COPY --from=builder /app/client/build /app/build
|
|
-# COPY --from=builder /app/server/node_modules /app/node_modules
|
|
|
|
COPY --from=builder /app/server/package.json /app/package.json
|
|
COPY --from=builder /app/server/package.json /app/package.json
|
|
COPY --from=builder /app/server/yarn.lock /app/yarn.lock
|
|
COPY --from=builder /app/server/yarn.lock /app/yarn.lock
|
|
|
|
|
|
|
|
+# Install git
|
|
|
|
+RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|
|
|
+
|
|
# => Reinstall production dependencies and clean cache
|
|
# => Reinstall production dependencies and clean cache
|
|
RUN yarn install --production && yarn cache clean
|
|
RUN yarn install --production && yarn cache clean
|
|
# Make our shell script executable
|
|
# Make our shell script executable
|
|
RUN chmod +x /app/build/env.sh
|
|
RUN chmod +x /app/build/env.sh
|
|
|
|
|
|
-# Make all files accessible such that the image supports arbitrary user ids
|
|
|
|
|
|
+# Make all files accessible such that the image supports arbitrary user ids
|
|
RUN chgrp -R 0 /app && \
|
|
RUN chgrp -R 0 /app && \
|
|
chmod -R g=u /app
|
|
chmod -R g=u /app
|
|
|
|
|
|
EXPOSE 3000
|
|
EXPOSE 3000
|
|
|
|
|
|
# RUN echo -e window.__version="{\"version\":\""$VERSION"\"}" > /app/build/version.js
|
|
# RUN echo -e window.__version="{\"version\":\""$VERSION"\"}" > /app/build/version.js
|
|
-CMD [ "/bin/bash", "-c", "/app/build/env.sh && yarn start:prod" ]
|
|
|
|
|
|
+CMD [ "/bin/bash", "-c", "/app/build/env.sh && yarn start:prod" ]
|