Skip to content

Commit

Permalink
Revert "dockerfiles make base basic"
Browse files Browse the repository at this point in the history
This reverts commit 76626cd.
  • Loading branch information
xHomu committed Sep 21, 2024
1 parent 6726e7b commit d432ffc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 23 deletions.
18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .
Expand All @@ -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
Expand All @@ -52,13 +47,14 @@ 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
COPY --from=core /app/public /app/public

# Start the server using supervisor
EXPOSE 3000
CMD ["supervisord", "-c", "supervisord.conf"]
CMD ["supervisord", "-c", "supervisord.conf"]


12 changes: 6 additions & 6 deletions fly/core.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .
Expand All @@ -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"]
CMD ["yarn", "run", "start:core"]

11 changes: 5 additions & 6 deletions fly/custom.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .
Expand All @@ -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"]
CMD ["yarn", "run", "start:custom"]

0 comments on commit d432ffc

Please sign in to comment.