diff --git a/Dockerfile b/Dockerfile index 699f2772..a33c7c68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,14 +13,14 @@ ENV IS_HOME $IS_HOME ENV NODE_ENV="production" ENV PORT="3000" -# Throw-away build stage to reduce size of final image -FROM base as build - RUN corepack enable WORKDIR /app COPY package.json yarn.lock ./ COPY ./patches ./patches +# Throw-away build stage to reduce size of final image +FROM base as build + RUN yarn install --frozen-lockfile --production=false COPY . . @@ -38,11 +38,6 @@ RUN yarn run build:custom # Get production dependencies FROM base as production -RUN corepack enable -WORKDIR /app -COPY package.json yarn.lock ./ -COPY ./patches ./patches - RUN yarn install --frozen-lockfile --production=true # Final stage for app image @@ -52,8 +47,7 @@ FROM base as runtime RUN apk add --no-cache supervisor # Copy over built assets for production -WORKDIR /app -COPY package.json supervisord.conf ./ +COPY supervisord.conf package.json ./ COPY --from=production /app/node_modules /app/node_modules COPY --from=custom /app/build /app/build COPY --from=core /app/build /app/build @@ -61,4 +55,6 @@ COPY --from=core /app/public /app/public # Start the server using supervisor EXPOSE 3000 -CMD ["supervisord", "-c", "supervisord.conf"] \ No newline at end of file +CMD ["supervisord", "-c", "supervisord.conf"] + + diff --git a/fly/core.Dockerfile b/fly/core.Dockerfile index dc1a6f50..cf02d396 100644 --- a/fly/core.Dockerfile +++ b/fly/core.Dockerfile @@ -13,14 +13,14 @@ ENV IS_HOME $IS_HOME ENV NODE_ENV="production" ENV PORT="3000" -# Throw-away build stage to reduce size of final image -FROM base as build - RUN corepack enable WORKDIR /app COPY package.json yarn.lock ./ COPY ./patches ./patches +# Throw-away build stage to reduce size of final image +FROM base as build + RUN yarn install --frozen-lockfile --production=false COPY . . @@ -36,12 +36,12 @@ RUN yarn install --frozen-lockfile --production=true FROM base as runtime # Copy over built assets for production -WORKDIR /app -COPY package.json ./ +COPY supervisord.conf package.json ./ COPY --from=production /app/node_modules /app/node_modules COPY --from=build /app/build /app/build COPY --from=build /app/public /app/public # Start the server by default, this can be overwritten at runtime EXPOSE 3000 -CMD ["yarn", "run", "start:core"] \ No newline at end of file +CMD ["yarn", "run", "start:core"] + diff --git a/fly/custom.Dockerfile b/fly/custom.Dockerfile index d8336b82..6386f5e4 100644 --- a/fly/custom.Dockerfile +++ b/fly/custom.Dockerfile @@ -13,14 +13,14 @@ ENV IS_HOME $IS_HOME ENV NODE_ENV="production" ENV PORT="3000" -# Throw-away build stage to reduce size of final image -FROM base as build - RUN corepack enable WORKDIR /app COPY package.json yarn.lock ./ COPY ./patches ./patches +# Throw-away build stage to reduce size of final image +FROM base as build + RUN yarn install --frozen-lockfile --production=false COPY . . @@ -36,12 +36,11 @@ RUN yarn install --frozen-lockfile --production=true FROM base as runtime # Copy over built assets for production -WORKDIR /app -COPY package.json ./ +COPY supervisord.conf package.json ./ COPY --from=production /app/node_modules /app/node_modules COPY --from=build /app/build /app/build COPY --from=build /app/public /app/public # Start the server by default, this can be overwritten at runtime EXPOSE 4000 -CMD ["yarn", "run", "start:custom"] \ No newline at end of file +CMD ["yarn", "run", "start:custom"]